hi, im making a fireball and it is almost complete, however, when i activate it to fire, it shoots backwards when i want it to shoot directly infront of the character. everything is on server side btw
local velocityDirection = (character.HumanoidRootPart.Position - clonedFireball.Sphere.Position).unit
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Velocity = velocityDirection * 200
BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
BodyVelocity.Parent = clonedFireball.Sphere
2 Likes
local velocityDirection = (clonedFireball.Sphere.Position - character.HumanoidRootPart.Position ).unit
I think you must subtract target position from hrp position
2 Likes
1 more thing if possible, the fireball slightly angles upwards at like a 15 degree angle
I have no idea can you send a video of the problem
Thats a big difference are you sure that you are calculating the target pos correctly?
1 Like
local velocityDirection = (clonedFireball.Part.Position - character.HumanoidRootPart.Position).unit
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Velocity = velocityDirection * 200
BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
BodyVelocity.Parent = clonedFireball.Sphere
im just doing this as i want it to fire directly out the humanoidrootpart
local velocityDirection = (clonedFireball.Part.Position - character.HumanoidRootPart.Position).unit
local Velocity = Vector3.new(velocityDirection.X, 0, velocityDirection.Z)
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Velocity = Velocity * 200
BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
BodyVelocity.Parent = clonedFireball.Sphere
Maybe this? I set the Y velocity to 0
1 Like
it fixed it! Thank you so much
1 Like
system
(system)
Closed
March 11, 2024, 1:06pm
#11
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.