- What do you want to achieve?
I want to decrease or remove completely the car bouciness/elasticity when colliding in a higher speed
- What is the issue?
The car is hitting so hard when colliding in a wall for example
- What solutions have you tried so far?
I tried to find in Devforum or any help in Google but i didnt find a thing. I already tried to change all parts CustomProperties (Elasticity to 0) but it still doesn’t work.
Video: Watch 2024-02-26 19-23-59 | Streamable
Have you also changed the ElasticityWeight
to 100 so it takes more priority?
If that doesn’t work, you can also try writing a script where if there is a sudden negative change in velocity, and a ray casted in front of the car detects a part, it could reset the rotational velocity of the car.
ElasticityWeight doesn’t work
For your second solution,
local RS = game:GetService(“RunService”)
local car = script.Parent
local PrimaryPart = car:WaitForChild(“PrimaryPart”)
local lastVelocity = PrimaryPart.Velocity
RS.Heartbeat:Connect(function()
local newVelocity = PrimaryPart.Velocity
if (newVelocity-lastVelocity).Magnitude < 0 then
end
end)
would I change “0” to a lower value? And also, do I need to check the magnitude sudden negative change inside raycasting or raycasting inside this heartbeat?
I made this, but it looks like doesn’t work properly fine and good like i’m trying to make it
local RS = game:GetService(“RunService”)
local car = script.Parent
local PrimaryPart = car:WaitForChild(“PrimaryInstance”)
local raycastDistance = 15
local lastVelocity = Vector3.new(0, 0, 0)
local rayparams = RaycastParams.new()
rayparams.FilterType = Enum.RaycastFilterType.Exclude
rayparams.FilterDescendantsInstances = {car}
rayparams.RespectCanCollide = true
local function detectCollision()
local raycastResult = workspace:Raycast(PrimaryPart.Position, PrimaryPart.CFrame.LookVector * raycastDistance, rayparams)
return raycastResult
end
local function checkCollision()
local currentVelocity = PrimaryPart.Velocity
print(“Doing”)
if currentVelocity.Magnitude < lastVelocity.Magnitude * 0.8 then
local collision = detectCollision()
if collision then
PrimaryPart.RotVelocity = Vector3.new(0, 0, 0)
print("Collision detected!")
end
end
lastVelocity = currentVelocity
end
RS.Heartbeat:Connect(function()
checkCollision()
end)
I used:
for i = 1, 2 do
if PrimaryPart.RotVelocity ~= Vector3.new(0,0,0) then
PrimaryPart.RotVelocity = Vector3.new(0, 0, 0)
print(“Velocity changed”)
end
task.wait(1)
end
And work a little bit better, but it’s still bad for me. It’s changing the velocity too late.
Maybe you can increase the friction of the tires? It may depend if you want your vehicle to be floaty or not.
Do you mean change it in _WHEELTUNE? Or is there another place to change it in A-Chassis?
I noticed that even though i’m on lower speeds if I collide in a wall it rotates too
Could you send a download of the car you are using? I can see about experimenting with the car.
I couldn’t find any solution sadly. I hope you do manage to figure it out eventually though.
1 Like
Yes, that’s sad. Thank you for helping anyways!