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

Object X axis and Local Space inverted? [SOLVED]

Asked by 8 years ago

I'm driving crazy here folks! please may someone explain me what's going on?.... I need discover which side of the object the mouse click was, so i would use the X axis value, if it is positive, left, otherwise right, simple! but no! the X axis seems to invert itself if i click from the other side of the object, look the image problem

the values shown in the output are the X axis value from the object's center to the mouse click position, using this command 'mouse.Hit:pointToObjectSpace(object.Position).p.X'

1 answer

Log in to vote
0
Answered by 8 years ago

Great news!! someone named "Operaman" gave me the solution, i'm very thankful! the solution was:

mouse.Target.CFrame:inverse()*CFrame.new(mouse.Hit.p)).X
Ad

Answer this question