How do I make part's orientation stay relevant to XYZ from Vector3?

So my problem is, we all know Vector3. It works fine, but when your character faces another way, the X changes to let’s say Z and all the values are messed up. How do keep Vector3’s XYZ be X is for right Y is for up and Z is for back, no matter which way I face?

I’m confused of what you’re asking for.

(I’m going to be using CFrame for this example)

Whenever you get the X, Y, Z co-ordinates of a CFrame, Z is always from the Axis of the Part.
For example, if you wanted something behind you, you could do:

Part.CFrame * CFrame.new(0,0,5)
The parts position will be behind the Part. This can be at any angle. To illustrate, here is a picture.

The Green arrow = Part Direction
The Black Part = Part
The Red Part = A new Part behind the Part

demonstration

Hope this helps :+1: :smile: :+1:

2 Likes