Problems with Hit Normals
I am having an issue with collision in my UE4 project. I am using the Flying template and while I have added things to it, the general sweeping behaviour remains. I added in "strafing" (ie, moving laterally without rotating the ship) and I am testing collision by grinding against walls (perpendicularly) using this strafing. The strafing relies on Sweeps, much like the default "thrust" motion, and on collisions the ship's Hit Normal redirects the plane (ie, it bounces off of walls) and player input is disabled momentarily (to prevent players from sticking themselves to solid walls). My "bounce" calculation is from this page, and uses the Hit Normal returned from Event Hits: http://stackoverflow.com/questions/573084/how-to-calculate-bounce-angle/573206#573206 I am printing Hit Normals on collision to the screen to help me debug.
On collisions with UE4 "default" objects (ie, left side of the screen -> Basic -> Cube or Cylinder), collision works perfectly. I can increase my speed, decrease my speed, whatever, and the bounces I get from the collision I have written is visually acceptable and results in a sensible Hit Normal. (I have Physics disabled, as is default.)
However, on collisions with BSPs, BSPs-turned-Static-Meshes, or imported Static Meshes (with UCXs or with in-engine-generated collision meshes), things get wacky. The issue seems to be specifically with what the engine determines to be the Hit Normal; it's less precise than with the "default" objects, and is inconsistent enough that it will deliver a Hit Normal of 0.14 or higher in X (the player's direction of travel), when the Default objects all play nice and give me 0.001X at most. (Again, the impacts should be perpendicular, with no Hit Normal in the direction of the player's travel; 0.001X is acceptable and probably just float imprecision.)
I suspect that my issue lies somewhere in the collision settings for the non-default objects, but there are simply too many different variables that could potentially be interacting with one another for me to simply sort this out through trial and error. (That doesn't mean that I haven't tried, of course; I'm also here because the IRC channel has no idea, either.) Some things I've tried:
I will record some .webms and post screenshots of my code/physics settings if this is not enough information. I will respond to all questions asking me whether or not I have tried some given solution yet, and will list my responses in the Question itself as I answer these questions, if possible. (I am working in Blueprints, but I am almost certain that the issue here is not with the code I have made, but with the settings I am using for the collision objects in question.)
Thank you very much for your time and thank you again if you have any help to offer.
Things that do not work: Changing collision settings on the custom mesh (both Enabled and Disabled do not change the collision behaviour):
Changing settings on the player Mesh:
Changing which Normal I use:
Follow this question
Once you sign in you will be able to subscribe for any updates here