Assembly Linear Velocity to move an object relative to another, accounting for rotation

This may be a little difficult, essentially the objective Im trying to achieve is moving a part in a different parts x/y(x/z technically Ig) coordinate frame.


How would I translate the rotation offset to the amount I need to add to the x and y in order for the object to appear to be going straight relative to the origin(object two)?

Can you not just take the Origins CFrame.LookVector (or RightVector or UpVector) and move Obj using that vector? CFrames also have a few methods to help with this sort of thing, like ToObjectSpace for moving a CFrame relative to another object

1 Like

Ah, I knew there was ToWorldSpace but didn’t realize there was ToObjectSpace. I look into look vectors further and see if I can get what I am after. Thank you

I can’t think of a way to use LookVector or toObjectSpace.
Im using AssemblyLinearVelocity in order to move objects which requires me to assign the velocity to the objects vectors. LookVector and ObjectSpace would give me a direction I want to go, but not the dx and dy that has to be used to get there.

AssemblyLinearVelocity is a Vector3 type, same as what LookVector would give you, I’m not really sure what else you need out of it. Are you trying to get the distance to a target position or something like that?

amnot sure if i understood this well this script will make part1 move along part2 with velocity

part 1 is OBJ part 2 is ORIGIN


local p1 = workspace.Part -- OBJ
local p2 = workspace.Base -- ORIGIN

p1.AssemblyLinearVelocity = p2.CFrame.LookVector * 50

change the * 50 value to change velocity idk if this is what you are trying to do

This did, had to use some of the other vectors too but the base was there :slight_smile: Ty Haggie too for pointing me in the right direction with the resources.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.