Seek advice from Vehicle Gurus. Working on Electric Slot Car Racing Sim using the advanced Vehicle Template. Works well on Track straight-aways, bank/twist, and curves, but I ran into a issue with the car staying on track in Loops.
I expect RC Sim to be used in fantastic ways with unrealistic loops.
My solution is a dual wheel upper/lower configuration for front and rear wheels (black) in which the track is sandwiched, keeping the car (red) on the track (yellow) when upside down.
[COLOR=#808080][SIZE=4]It is not necessary for the low wheels to be visible. So I figured I just go into PHAT and duplicate the F/R Wheel Sphyls bodies. However, I’m not seeing the effect of the physics in game:(
No other modifications have been made. Do I need to modify the Vehicle Animation BP? Any advice will be gladly accepted.[/SIZE][/COLOR]
To my understanding PhysX vehicles in UE4 are treated as kinematic bodies, which means - you can attach physics bodies to it but they won’t affect kinematic body. The point is that “roller-coster wheel” setup won’t work with PhysX vehicle as a base class.
There were multiple discussions in past regarding issues Physx vehicle experience on looped tracks:
Since you are having your vehicle stuck on a track why bother in creating an actual vehicle anyway? All you want to do is essentially animate it going along a spline path and check if its going too fast along the corners to make it fall off right?
Hi BoredEngineer Thank you for weighing in on this, and the information.
There are 4 areas that I’m looking at in the implementation:
Track Design (with Top beams to prevent fall)
Splines Mesh for Track
Vehicle PHAT setup
The physics are finicky with standard setup. The vehicle will intermittently complete the loop, just not on a guaranteed basis. I’m also considering this technique for racer in which cars hang upside down on the track. Ill start looking into the other areas. Thanks again.
Hello ZoltanJr, thanks for reading and responding.
The Vehicle solves a lot of custom physics issues and works every now and then. There are issues using Spline loops as show here. I’m actively seeking a solution to this to simplify track construction. One idea is to use two tracks, equal and opposite-side up.
I don’t think it will solve it if you use Vehicle template - they are not physical bodies, they like a character movement component. You will have to dig into their C++ implementation to solve this. ZoltaJr raises a good question, it doesn’t look like you have a use case for physically simulated cars. That issue with spline you’ve mention can be simply related to not enough geometry of the track section or he doesn’t properly handle “flipping” of the spline as it always points to up vector that you provide in settings.
Hi BoredEngineer. I’m restricted to finding a Blueprints Solution. I’m using a custom made track mesh with plenty of geometry (learned the hardway). The spline flipping is a commonly known issue, but there may be a hack for it here. Spline Meshes are great to create simple track straight-aways, with slight curves/bends. My back up plan is to use Static Track pieces/sections for complex loops and twists.
Hi TooManyfps, thanks for reading and responding. I’m using two Thrusters: Forward Propulsion, Counter-Gravity. The results are pretty good and rather entertaining. I’ll consider your recommendation for a means to automate thruster control.
Yes, that’s one of the ways to fix it. For tank tracks for example I’m just checking if Y component of spline direction vector is positive or negative and roll mesh according to that by 180 degrees. This won’t work in exactly the same way for free firm spline - tracks are parallel to X axis of tank, but something similar can be done.