so i have a projectile script that makes the projectile go to the mouse’s direction, but instead taking a direct route, it chooses to curve??
(amazing drawing i know)
the green is where its suppose to go, and the red is where its going right now. i am using bodyvelocity for the projectile movement
ingame pic
1 Like
Check where the points from which the line is drawn…
And also it would be helpful if you included footage from in the game.
velocity part
local velocity = Instance.new("BodyVelocity")
velocity.MaxForce = Vector3.new(5000,5000,5000)
velocity.Velocity = (mouse*100)
velocity.Parent = clone
1 Like
Thanks!
Ooh wow…I don’t specialize in this field of Development. Maybe your new camera angles overlapped with Roblox’s to create something weird.
i tried it in first person and got the same result
so how would i fix it? (my game is designed for first person)
1 Like
Wait are you talking about the balls or the camera?
1 Like
the balls, they have a curved path to the mouse
mouse.hit.position works but it goes differant speed depending on the distance.
Oh…I think that’s just default stuff messing you up…that’s normal. It’s kind of weird, I know.
It sometimes ruins my special effects in a game.
Sorry I’m not really experienced in this topic.
1 Like
Forummer
(Forummer)
June 22, 2022, 1:00pm
#17
You need to apply a force to the projectile in its upwards direction to counteract the effect of gravity.
local Workspace = workspace
local BodyForce = Instance.new("BodyForce")
BodyForce.Force = Vector3.new(0, Projectile:GetMass() * Workspace.Gravity, 0) --Weight = Mass * Acceleration, (f = ma).
BodyForce.Parent = Projectile
2 Likes
ifkpop
(ifkpop)
June 22, 2022, 1:06pm
#18
In order to ignore distance, call .Unit
on a Vector3
or Vector2
. Multiplying this result with your wanted velocity will always end up as that velocity, no matter if it is 1 stud away or 10^303 studs away.