I am trying to make a custom skateboard. I have turning and such, but I haven’t gotten the forward movement to work correctly. All of the constraints I have tried apply CONSTANT movement but I want more of smooth movement. I am trying :applyimpulse but I don’t know how to make the vector3 localized to the base part. If there are other ways to do this that would be appreciated.
Uhm another way is to utilise raycasting and using CFrame to make the skateboard move. You would cast a ray to the ground and set the CFrame relative to it and allowing for it to be modified via keyboard input.
To add smoothness you can use a spring module. There are many springs modules out there but it’s up to you which one you use.
If you did want to use ApplyImpulse for a simpler solution, you can do CFrame * Vector3 to convert the vector3 from object to world space, which would probably be what you want.
(CFrame | Documentation - Roblox Creator Hub)
I found an easier solution with bodyforce and this script:
skateboard:GetPropertyChangedSignal("Throttle"):Connect(function()
while skateboard.Throttle >= 1 do
local currentanims = "Push"
animevent:FireClient(game.Players:FindFirstChild(skateboard.Occupant.Parent.Name), currentanims)
forward.Force = skateboard.CFrame.LookVector * 500 * skateboard.Throttle
wait(1.5)
end
forward.Force = Vector3.new(0, 0, 0)
local currentanims = "Idle"
animevent:FireClient(game.Players:FindFirstChild(skateboard.Occupant.Parent.Name), currentanims)
end)
I forgot that the lookvector is a vector3 so I could use that for an easier way to point in the correct direction.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.