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

Why wont this change the orientation of my car chassis?

Asked by 5 years ago
Edited 5 years 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 882 Moderation Voter
5 years ago
Edited 5 years 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 1055 — 5y
0
this is what i mean https://imgur.com/a/WCGHms5 Gameplayer365247v2 1055 — 5y
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 882 — 5y
Ad

Answer this question