Well, i’m trying to make a missle, and i don’t know how to do it…
Sorry for bad english
Well, i’m trying to make a missle, and i don’t know how to do it…
Sorry for bad english
Since you’re using a Bezier curve, it should be easy to figure out the next position of the missile. You can just calculate that, then use CFrame.lookAt
to orientate the missile to look at that position
i tried it, but it didn’t worked.
What doesn’t work? Does it not orientate in the right direction?
yes, i’m using a cylinder for testing but it just don’t chance the angle.
Can you show me a screenshot or a video of the problem?
The cylinder’s rotation is just offset. Try rotating it 90 degrees along the Y-axis in addition to using CFrame.lookAt.
Example:
--at the top of the script
local rotOffset: CFrame = CFrame.Angles(0, math.pi, 0) --90 degrees
--inside the loop
cylinder.CFrame = CFrame.lookAt(bezierBefore, bezierAfter) * rotOffset
It seems to be aiming towards where the mouse is rather than the cylinder’s direction. Are you sure the code is set up correctly?