Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How Can I Use BodyThrust to Make an Object Travel in a Straight Line Despite Orientation?

I'm trying to create a tool where an unanchored projectile moves/rolls in the direction the player is facing by inserting a BodyThrust into the projectile.

Everything is working other than the fact that, once the projectile rolls or tumbles at all, the thrust will continue to act on the brick in the original direction relative to the brick (essentially making it fly all over the place rather than just go in the one direction regardless of the part's orientation). Is there a way to fix this so that the projectile will always thrust towards that initial direction?

2 comments

0

What is your use case?

0

What do you mean by "use case"?

2 answers

While BodyThrust moves relative to the part, BodyForce does not.

You can use this instance to move the part regardless of the part's orientation.

2 comments

0

This seems like the answer to my question! Do you know a way to make the force the direction the player is facing?

0

@corncob567 You need to take the lookVector of the player's humanoidrootpart's CFrame, so Force=HumanoidRootPart.CFrame.lookVector, then you can times that vector3 to go faster

This discussion is preserved as it was. New answers, comments, and votes are closed.