#:pivotTo() clipping under floor

1 messages · Page 1 of 1 (latest)

mint yew
#

car:PivotTo(CFrame.new(car.Position.X, car.Position.Y + 5, car.Position.Z) * CFrame.Angles(0, car.Orientation.Y, 0))
flips my car, but sometimes it clips my car under the map, no idea why

neon quartz
#

You should add the +5 on the y axis using .position

#

assuming ur car is upside down, adding 5 to the y axis of cframe will just move the car upwards in it’s relative rotation.

mint yew
#

wdym by .position?

lethal shardBOT
#

studio** You are now Level 3! **studio

mint yew
#

do you mean setting the Y value first before?

#

additionally, how do i animate this similar to tweens?

sullen pendant
#

is everything parented to your car model?

#

if not then you need to move all the parts connected to the car

mint yew
#

yep everything is parented, i think i fixed it by modifying the line to this

#

car:PivotTo(CFrame.new(car.Position + Vector3.new(0,3,0)) * CFrame.Angles(0, math.rad(car.Orientation.Y), 0))

#

i say i think because the bug hasnt happened so far

mint yew
#

nvm its still teleporting downwards for some reason

#

btw im moving a the primarypart of a model

mint yew
#
chassis:PivotTo(CFrame.new(chassis.Position + Vector3.new(0,3,0)))
            task.wait(0.1)
            chassis:PivotTo(CFrame.new(chassis.Position) * CFrame.Angles(0, math.rad(chassis.Orientation.Y), 0))```
#

i did this but it still teleports downwards sometimes

#

even flipping it and making the car rotate first and then tp upwards

mint yew
#

bump