top of page

Making a Racing Game Framework Part 2

 

Now we've actually got the project up and running we need to figure out what we need to create, The main two aspects we'll be focuing on for the moment are Determining who is in what position in the race and Getting other players into the game

 

Determining who is in what position

 

We can do this plenty of ways however the way Im going to explain today is using Splines (Which we already have as that's what the road is made of) We have a handful of nodes that'll help us with this such as:

 

Get Spline Length

This gives us the total length of the spline from start to finish regardless of the amount of points or their location along the spline

Get World Location at Distance Along Spline

This gives us the physical location within the world at a given distance along along the spline, for example if I have a spline with two points from (0,0,0) to (0,0,10) and I input a distance of 5, it'll return (0,0,5)

Get Distance Along spline at Spline Point

This gives us the phyiscal location within the world at a given point on the spline, using the example above if I input a Point Index of 1 it would give me 10, while if I put in 0 it would give me 0

Get World Rotation at Distance Along spline

This gives us the Rotation of the spline at a certain distance along its track regardless of the points along the spline

So, what are we actually going to be doing to determine who is in what position in the race? Well we have a spline in the centre of the road but we need to add more points to it (If we add more points it'll change the way the road functions though) So we'll have to make a new Spline Component within our ConstructionScript and add points to it. 

We want to make a large amount of spline points on our new spline which follow the middle spline (Something like the bottom image)

© 2023 by Web-Designer. Proudly created with Wix.com

  • s-facebook
  • Twitter Metallic
bottom of page