How is my realistic skateboard?

No, wheels, servos or seats were used to create this, just linearvelocites, the skateboard and character also have cancollide set to false, using a raycast to make the character stay above ground

Vid: Watch Skateboard physics | Streamable

6 Likes

This looks more like a hoverboard mechanic than a skateboard. I would introduce friction more as a factor and decrease the power. This is a good start though.

6 Likes

This looks great, just one question, how exactly did you make the player turn to align themselves with the floor normal, I’ve been trying to do it for my own game?

1 Like

friction is apart of the code, hence why it slows down

1 Like

pretty simple

Here you go:

   ---------------------- Tilt ----------------------------------

	y_radian = math.rad(root.Orientation.Y)
    x_radian = -math.asin(-ray.Normal:Cross(root.CFrame.RightVector).Y)
	z_radian = math.asin(-ray.Normal:Cross(root.CFrame.LookVector).Y)
    local angles = CFrame.Angles(0,y_radian,0)*CFrame.Angles(x_radian,0,z_radian)
    root.CFrame = CFrame.new(root.Position)*angles
2 Likes

Hey, really late here, but can you tell me if the code u wrote is on the client or server since linearvelocity is known for lagging on the server

1 Like

it was written on the client, the input will be delayed on the server and if the server runs lesser than 60 fps it becomes a problem, so youre right about that

1 Like

hey thanks for responding this quickly, i honestly didnt expect you to, anyway doesnt this make it not safe, i mean anyone could edit the client, is there a potential solution that doesnt require a separate anti cheat

1 Like

lets be real, they can already do that with their base character, pretty sure they can alter their own roots velocity to fly if said game doesnt have any anti flight scripts, the same applies here

1 Like

as long as said anti cheat detects abnormal movement and fixes it, it should work with the skateboard script

1 Like

yeah sure, sounds like a solid concept honestly, again thanks for responding, anyway i have one last question if thats fine, how did you make the board / part stop when it hits a wall for example, since currently im making a BMX game and i decided to use motor hinges and make it physics based, but the hinges keep rotating even if i hit a wall. I believe linear velocity(the one u said u used) behaves the same way, as it doesnt automatically stop the object when it hits a wall.

1 Like

okay so, the tilting I just use AlignOrientation with rigidity enabled, any movement forces are the result of linear velocity, with a good enough max force as to not clip through walls at a certain speed

1 Like

thanks a lot for helping i really appreciate it!!!

2 Likes

how are they turning so incredibly well on a skateboard

1 Like

Hey uh, its me again. I have one more question, what was the setup for your linear velocities? What i mean is like did you handle slope physics with a separate linear velocity, ooor is all of the movement achieved through only one linear velocity object? Again sorry for the late question, I would really appreciate it if you answered!