How would you script a skateboarding game?

How would you script elements in skate games like skate 3 where it detects if you’re on a ledge for grinds and stuff and if there’s a ledge nearby the game will guide your character towards it?

1 Like

There is no definite way but one way would be to make ledge parts with hitboxes for both on ledge and for near ledge. You can also use raycasting instead of hitboxes which might work better since it can get the normal vector of the face it hits allowing you to get slope.

I haven’t scripted a skating system, but car mechanics are somewhat similar so here’s my suggestion:

I’d probably use a raycast or two on the bottom of the skateboard itself to detect what’s directly below the skateboard from a certain position. From there you can handle rails and whatnot however you wish. You could differentiate rails / grindable surfaces with some kind of custom attribute or do it however else you’d like. I’d also recommend having very solid basic skating mechanics before doing something like this, in the case that you redo basic skating mechanics, or don’t have a strong foundation, this will not be a worthwhile thing to add.

Good luck with your game and I’d be happy to try and answer any other questions you have

both replies are great answers, I’ll be looking back at these whenever I get my base down.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.