Hello, I created a levitation script. When the character points up, the levitating object goes up, same with down, left and right. The problem is that in my method, if the char goes behind the object (in world space), the movements become inverted, sinse the scripting is adding worldspaced vector3 to the object position. What I need is to make the object go aways to the Char’s right when I press to go right, and not the world’s right.
So the scrips now is like this: (in a loop, using BodyPosition mover)
You will need to use CFrames to achieve this function. In particular, you will want to use CFrame.LookVector which gives the position and orientation relative to the object.
Using the position property only gives the numerical position and not the direction Of orientation of the object, so adding to this position property is doing so in world space and not relative to the object.
i know, but i dont want only to move the object relative to itself, its own look vector, but I want it to move according to another part look vector. How do i do that?
I’m not sure if I understand properly, but from what I do understand, you want to move the part based on the character’s rotation. in that case, you can do
I tested, this makes the part goes directily to the HumanoidRootPart position and add XYZ to it. I want the part to move according to its own position but player’s lookvector
I mean, i made “BP.Position = (root.CFrame * CFrame.new(mx,my,mz)).Position” because im using body mover