#How do I rotate a part when it reaches a part
1 messages · Page 1 of 1 (latest)
How do I rotate a part when it reaches it
How do I rotate a part when it reaches a part
you would put the script of rotation after the tween has been completed
so after the completed
yup
ok thx I'm trying this
also I'm kind of coufused why are you trying to find a cframe of a table?
"goal.CFrame"
because I have a model with waypoints and I'm looping through it so that I don't have to write that much
So the car should move from point to point
right now by having trying to use goal.CFrame you would get a error because the table doesn't have propertie called Cframe
no it moves perfectly
oh okay
can use the Tween's Completed event, which can be called also if its canceled
or maybe I'm missing something here, what does the first rotation
what do you mean with first rotation?
Sorry, I think I understand now.
You can't really compare CFrames like that because rounding errors make the situation where those two are equal incredibly rare.
By using the FuzzyEq function, you can check if the cframe is close enough to the other by giving it an "epsilon", basically the number the distance has to be less than before itll consider them equal.
so CFrameA:FuzzyEq(CFrameB, .0001) you may need to play around with the epsilon value so it works for your situation
This takes into account position & rotation
thx
this could work
it worked
shit it doesn't stasy
stay
in the angle
it rotates bakc
When you give the properties table to the Create function, it won't update when you change the table later
I suggest you just create the tween a little later, when the goal CFrame is ready