Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why wont this change the orientation of my car chassis?

Asked by 6 days ago
Edited 4 days ago
script.Parent.Touched:Connect(function(hit)

if hit.Parent.Name == "Jeep" then

hit.Parent.Chassis.Orientation = Vector3.new(0,-180,0)

hit.Parent.Chassis.Anchored = true

wait(1)

hit.Parent.Chassis.Anchored = false

end

end)

1 answer

Log in to vote
0
Answered by
Psudar 83
5 days ago
Edited 5 days ago

I think I see your problem. I set up a small test w/ the same script just to try it out myself. You're rotating it 180, assuming it's orientation is already 0, it won't actually look any different.

So, try rotating by 90 degrees instead. I'll include a small clip of what I made, hopefully this helps.

Also I assumed that "Jeep" was a model and "Chassis" was a member of that model.

I'd recommend not rotating things by touched events :P

```lua

script.Parent.Touched:Connect(function(hit)

print(hit.Parent.Name)

if hit.Parent.Name == "Jeep" then

    hit.Parent.Chassis.Anchored = true

    hit.Parent.Chassis.Orientation = Vector3.new(0, 90, 0)

wait(1)

hit.Parent.Chassis.Anchored = false

end

end) ```

Clip: https://gyazo.com/d42aad310dd11ec3ffbfd199269bd045

0
this didnt work for me, i have a little teleportation system that i want to rotate the car no matter what angle u drive in with but it dont orientate it Gameplayer365247v2 252 — 4d
0
this is what i mean https://imgur.com/a/WCGHms5 Gameplayer365247v2 252 — 4d
0
ah. maybe when they drive in, have their orientation automatically change to 0, so that its easier to work with. hope you figure it out. Psudar 83 — 4d
Ad

Answer this question