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

How would you simulate a crash with Body Velocity without flipping the part?

Asked by 9 years ago

I created a vehicle which runs on a velocity object. Problem is, when I hit a wall, the rear fly's up and over the front of the vehicle trying to reach the given velocity. Is there any way to "Tame" this behavior? I've tried using bodygyro, but I would like it to adjust to ramps as well. Here's an example of what I'm trying to achieve, just take a car and ram it into the first wall you see. : http://www.roblox.com/Driftz-place?id=149996489

1 answer

Log in to vote
0
Answered by
yoshiegg6 176
9 years ago

Try making the car stop if it hits something that isn't named ramp. So, if you want your car to stop when it hits something don't name it ramp. For example:

velocitygiver = script.Parent.Parent.VELOCITYGIVERNAMEHERE --[Change this to whatever it is that has velocity in your car]--

function stopscript(part)
if part.Name ~= "Ramp" then --If its not a ramp then
velocitygiver.Velocity = Vector3.new(0,0,0) --Stop the car
script.Parent.Touched:connect(stopscript) 

This is made assuming the car is a model.

0
Problem with the second part is when it's on a ramp and it hits a wall, it randomly straightens out. Orlando777 315 — 9y
0
And no, setting it in the middle makes no difference. Orlando777 315 — 9y
0
How about making an onTouched script that puts the cars velocity at 0 when it touches something thats' not a wedge. I'll change my answer to show what I mean. yoshiegg6 176 — 9y
Ad

Answer this question