New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
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 1 year ago
Edited 1 year 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 853 Moderation Voter
1 year ago
Edited 1 year 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 864 — 1y
0
this is what i mean https://imgur.com/a/WCGHms5 Gameplayer365247v2 864 — 1y
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 853 — 1y
Ad

Answer this question