#How do I rotate a part when it reaches a part

1 messages · Page 1 of 1 (latest)

dusk shadow
#

I want that the car rotates when it reaches the "rotationpart"

#

How do I rotate a part when it reaches it

#

How do I rotate a part when it reaches a part

void zodiac
#

you would put the script of rotation after the tween has been completed

dusk shadow
#

so after the completed

void zodiac
#

yup

dusk shadow
#

ok thx I'm trying this

void zodiac
#

also I'm kind of coufused why are you trying to find a cframe of a table?

#

"goal.CFrame"

dusk shadow
#

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

void zodiac
#

right now by having trying to use goal.CFrame you would get a error because the table doesn't have propertie called Cframe

dusk shadow
#

no it moves perfectly

void zodiac
#

oh okay

glossy sphinx
#

or maybe I'm missing something here, what does the first rotation

dusk shadow
#

what do you mean with first rotation?

glossy sphinx
# dusk shadow 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

dusk shadow
#

thx

#

this could work

#

it worked

#

shit it doesn't stasy

#

stay

#

in the angle

#

it rotates bakc

glossy sphinx
#

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