Flying Template (Building Better Collisions)

The current collisions for the flying template have the craft come to a complete halt when there is collision. I want this behavior only when I run directly into a wall, if I skim a wall or the floor I would like this to slow the craft over time. Can anyone assist on what needs to happen BP wise for this?

Also the current camera set up seems to get stuck in walls a lot. Is there a better set up that will prevent this from happening? Thanks for any help/advise.

Hate to bump this but it has been out there for quite some time and I really could use some help here.

I really appreciate the template that epic put out but it seems like this template was put out with not much in terms of functionality and very little explanation on how to turn it into something more than what it already is.

I would really like to understand why the camera gets stuck so bad.

I also created a large collision “cage” in the world to keep the ship in a particular area, but for some reason the ship can collide through and then gets stuck on the other side.

+1, (7 characters needed)

Can someone at Epic look at this template and help me understand why collision really doesn’t work correctly with this template? The camera or the ship gets stuck in geo that it should never penetrate with. There are times that you can move your ship through a collision object.

So in the flying template (demo) that epic provided there is a node that causes the flying speed to go to zero as soon as you hit something. Even when disabling this in the craft blueprint the behavior of the craft coming to a complete stop when hitting another object still persist. You can also set a phys Material Override, I have tried this as well and played around with the friction values. So now in the world I have better interaction between smaller bodies there is something collision wise that is at least passable, but when hitting larger objects the craft gets stuck on say the ground or side a a wall, instead of bouncing or skimming off, then if you steer the craft away from the surface it will get unstuck and shoot off into what ever the vector of the craft is. I’m looking for the craft to have similar bounce interaction as the content examples blueprint example they have of the flying ship that can interact with the cows in a pasture and spit them into the fenced in area. Now that craft has an entirely different movement system, so I’m not sure if that is way that craft works better with collision or not. I found this thread where someone was building something similar with a slight work around (Flying template - bounce or slide off collision with no physics? - World Creation - Epic Developer Community Forums) the problem with this is that I am building a VR experience and this solution causes the camera to bounce violently. (Not good for a VR experience at all!) Any help would be greatly appreciated!

I did the same exact thing quite a long time ago and you’re definitely on the right track with tweaking the Phys Mats … Setting the ship hull material to complete zero friction is a good first step to get some bounce working. After that it kinda depends on the design for your game. Running a physics sim in 6DOF in multiplayer is a recipe for disaster (even more so in VR) where your client will have to skip around in space to keep up with the server version due to ping times. But it could be an option for a single player game. For that, forget using the movement component of a character and fly by physics impulses using a pawn instead.

If you want tighter control without a physics sim (say for MP) then you may have to redirect your velocity manually in code or in a BP. Say for example you detect hitting a wall via collision - a cheap way using only the hit normal of the thing you struck and your own velocity, you could go along the lines of:

NewVelocity = 0.8 * (( CurrentVelocity dot HitNormal ) * HitNormal * -2.0 + CurrentVelocity)

(0.8) - Tune this downwards to take some oomph/energy out of the impact

(CurrentVelocity dot HitNormal) - This factor makes a head on collision slow you down way more than a skimming impact… however you also get more boiing from head on than from skimming I’ve found

The rest - This basically creates a reflection angle post impact getting you going in a new direction

This is obviously way striped down compared to a true physics simulation but it does work in a just-for-fun sense pretty well.

Thank you for the response! I’m going to start exploring some of these options you listed! Much appreciated!

Did you ever figure this out, or get any help with it? I’m having the same problem now