Hello,
I have a problem with a bumper car that doesn’t align with the ground when spawned on a not flat ground. (The car does not change angle)
I already tried to modify the script but does not fix anything.
this is the problem :
Thank you for you answers !
tyler09456
(RollMysts)
October 27, 2024, 7:51pm
#2
Can you explain more on how this system works? Is it physics based or using CFrame.
The mouvement sytem is based on mooving with angular an linear velocity ( so yeah CFrame)
tyler09456
(RollMysts)
October 27, 2024, 7:56pm
#4
Okay, are you able to provide a snippet so I can better understand?
local bodyGyro = Instance.new("BodyGyro")
bodyGyro.MaxTorque = Vector3.new(1e5, 1e5, 1e5)
bodyGyro.CFrame = primaryPart.CFrame
bodyGyro.P = 3000
bodyGyro.Parent = primaryPart
local function updateMovement()
local throttle = seat.Throttle
local steer = seat.Steer
local forwardDirection = seat.CFrame.LookVector * throttle * 50
local strafeDirection = seat.CFrame.RightVector * steer * 50
local movementVector = forwardDirection + strafeDirection
if throttle ~= 0 or steer ~= 0 then
bodyVelocity.Velocity = Vector3.new(movementVector.X, 0, movementVector.Z)
local steerMultiplier = 10
local steerAngle = steer * math.rad(-5 * steerMultiplier)
local targetCFrame = primaryPart.CFrame * CFrame.Angles(0, steerAngle, 0)
bodyGyro.CFrame = targetCFrame
else
bodyVelocity.Velocity = Vector3.new(0, 0, 0)
end
end
tyler09456
(RollMysts)
October 27, 2024, 8:02pm
#6
Does the bumper car start at that unstable position or does it happen after moving?
Sorry for the stream background sound
tyler09456
(RollMysts)
October 27, 2024, 8:08pm
#8
Oh I see, so it’s not correcting it’s rotation, one way of fixing this could be raycast at the bottom then counteracting the current rotation to stay level, unsure how well it would work for this situation though.
system
(system)
Closed
November 10, 2024, 8:09pm
#9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.