I’m having trouble understanding why VectorToObjectSpace is printing Vector3(-1, 0, 0) i’d really appreciate it if someone can help me understand this!
– My code
local Part = workspace.Part
local Direction = Vector3.new(0, 0, -1)
local worldSpace = Part.CFrame:VectorToWorldSpace(Direction)
local objectSpace = Part.CFrame:VectorToObjectSpace(Direction)
print(worldSpace) – Prints Vector3(1, 0, 0)
print(objectSpace) – Prints Vector3(-1, 0, 0)
VectorToObjectSpace turns a vector, assumed to be relative to the world, and returns a vector that is relative to the provided CFrame. VectorToWorldSpace turns does the opposite. if you input the way the object is facing into VectorToObjectSpace, it would return Vector3(0,0,1). and if you input Vector3(0,0,1) into VectorToWorldSpace, it would return the way the object is facing.