One of my developers and I are working on vehicles similar to the ones in Rocket League. But we genuinely cannot find out how to make the vehicles drive on the walls such as they do in Rocket League. We cannot use bodyvelocity as it will break the acceleration. Any ideas or suggestions on how to make this possible?
One hack would to flip the arena but that would be very intensive and not very practical.
If only roblox had vector 3 based gravity.
Set gravity at 0 and have a body force pointing down relative to car unless car flipped…
Prolly a bad idea. But might work
Back in the day I made a hexagonal maze world on a geodome. Back then Roblox didn’t have the fancy physics objects it has now. And to make matters worse I had to play animations on the characters. After days of fighting with the Humanoid, I finally had a glimpse of why many experienced developers hate it.
You can use the gravity property of the workspace to remove the current gravity. Then if your map is convex you can use a LineForce. Using a LineForce will make transitioning between walls easier, but may make moving to the center of surfaces harder. If this is not desirable or your map is not convex then you will need to constantly be able to find the normal of the surface you are driving on and apply an inverse force to the vehicle. Determining when to switch surfaces and normals can be bug prone and game dependent. For example, in Rocket League the vehicles start to fall to the natural floor if they leave a wall. This wouldn’t be desirable in some non-convex maps. I’ll forgo writing a lengthy post on determining surfaces/normals unless you want to go down that route. Since LineForce didn’t exist back when I made my maze world, I always kept track of what maze cell players were in and that cell’s normal.
What I found difficult for player movement was when to switch the movement directions to be relative to another surface. If you are using a physics based vehicle (the wheels friction cause the force) then this wont be a problem. Also if your space is convex and players stay inside of it, then any incorrect force will be corrected by a collision with a surface since all angles traversed over are less than 180 degrees. This wasn’t the case on my maze world since players were on the outside, any incorrect force would make players walk into the air rather than apply some force into a surface. Once gravity would switch over, then they would fall back down. So, if you have a non-convex map then you can expect to spend most of your development time in transitions between surfaces.
What kind of map are you envisioning? Will the simple LineForce method work?
Solved it by adding some bodythrusts in the axles of the car and gave them a thrust downwards when they are touching something underneath. Thanks for the help everyone!
You should put them on the whole vehicle if it has suspension, gravity affects all objects.