Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I use a local axis in scripts?

Asked by
cancle5 120
1 year ago
Edited 1 year ago

I have recently been working on a project and I ran in an issue where whenever I move a part with a script it always moves on the global axis. Let's say I want to move a part 1 stud on the local axis, how would I do that in a script?

Basically moving something on the local axis is moving it left or right accordantly to the parts position and rotation.

local Part = --the part

Part.CFrame = Part.CFrame + Vector3.new(1, 0, 0) -- Moves on the global axis.

(Example of how I want it) https://youtu.be/X7TAO-cQHh8

Answer this question