I’m trying to make my VectorForce always move me to the left, no matter where I’m facing.
I am brain-dead today so I’m not sure what I’m doing wrong. This is what I’m using:
v.Force = char.HumanoidRootPart.CFrame.rightVector * -15000
I know this isn’t a lot of information but some help would be nice! I can apply more if needed.
I’d go like this:
v.Force = Vector3.new(1, 0, 0)
v.Attachment0 = char.HumanoidRootPart.MovementAttachment
v.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
You’ll need to create an attachment for movement parented to the HumanoidRootPart.
1 Like
What is “MovementAttachment”?
Also I’d really just like help with the math so I can understand it better. Thanks though
It is an Attachment instance with all default properties besides its name. It is one of the really cool features of the new physics system so I’d recommend looking up how to use it on the wiki.
Really, attachments are meant to take call the math out of what used to be complicated operations and move all of the computations over to the engine. Whoever came up with this I think was a genius. To sum it up, An attachment defines a CFrame relative to its parent BasePart. It is called an attachment because multiple physics objects can then be ‘attached’ to that relative CFrame. Attachment start as the same as their parent’s CFrame, so attaching the vector force to it makes our force always relative to the HumanoidRootPart’s CFrame without any math. The Force of the VectorForce means go left, and since I changed RelativeTo from world to attachment0, it means go left relative to attachment0.
4 Likes
I see. I had no idea that you could do that, thanks!
Still would like help with my terrible math skills tho