I'm making a third-person vehicle game where the player drives around in a little pod vehicle that hovers a few feet off the ground. Right now it's a static mesh that's been parented to a capsule component (it's based on the default character blueprint), and it works just fine in that regard, but I'm trying to get it to do two things:
I'm guessing the best way to do this is get rid of the capsule component and get the physics-enabled mesh to hover above the terrain and stick with the controller, but I'm not sure how to do this (or any other methods of getting this to work). I also thought it might be possible to constrain the vehicle to the capsule via spring arm, but that seems to only work for cameras. Any suggestions?
asked Oct 04 '14 at 02:30 PM in Blueprint Scripting
You will definitely get rid of the character controller and build your own controller to simulate the hovercraft. There are a couple of routes to go with the hover craft physics.
1 is the easiest if the hovercraft is mostly going straight'isn since you drive it like a simple dune buggy.
That said the physics simulation for a hover craft shouldn't be to hard. You have an array of sample points over the hovercraft' skirt where it meets the body. You do a ray trace to the ground and apply a force at the sample point position proportional to the height. In effect its a spring system (like a loose suspension). Thrust is then applied via the rear motor angled by whatever direction you are holding.
This means there is nothing in contact with the floor and thus it'll slide sideways etc.
answered Feb 27 '15 at 07:26 AM
Two possible starting points for you, if you have not already discovered the pages on the documentation:
and for the content side of things:
When first adding your FBX file you need to open up the Physics Asset then delete all the bodies which are created automatically. Then you can create new bodies, such as a box, sphere etc. Please remember to set the body covering the vehicle chassis to Kinematic and the same for any wheels. This is in the documentation and should fix your problem with the physics displaying undesired results.
Also epic has a bit more about setting up vehicles on their youtube channel.
Sorry about the general advice, but often I find the simplest solution to usually work best.
answered Oct 04 '14 at 05:08 PM
Hey ) I've been facing the same kind of problem recently, and i was trying this and that. The thing i don't like about not using the character blueprint and using just physics model is the amount of the control. It's hard to control physics model a bit so i came up with another solution so far. Maybe it will help you. Check out my post in here
Regarding the collision bounce it's just eh matter of adding impulse on an impact with direction of the impacted surface normal. No a big deal to add in that case.
P.S. I'm using the skeletal mesh for the car aswell.
Check out the physics tutorial if the new game space dust. Michael created a good run down on how to create the suspension your looking for
answered Dec 10 '15 at 06:21 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here