Force on Static Mesh Component sometimes ignored
So I have an actor class which contains 1 static mesh component and code to handle some gameplay things. When spawned a force is applied to the skeletal mesh body instance like so:
about 90% of the time this will cause the actor to fly out with the desired physics (inc gravity), but the other 10% it will actually fail to move and just fall down with gravity as if stuck. Note that I get this using the exact same Blueprint parent, so each object is the same.
Now these actors are being spawned on a socket of the player so there is overlap between the two, however the skeletal mesh is being spawned with an overlap condition of all pawns (in fact we have gone to the extreme to fix this by making it overlap all object types, but still have the both physics and query collision enabled).
I have put logging in to ensure that the force is actually being set to a reasonable value in all cases, and it is.
If nothing is set to block this mesh, what else could be causing our actor to not actually move at all. The only component it has is the static mesh component (which is therefore the root one). Why would it work 90% of the time? What other things can I debug to try and work out what is going on here?
From my logging here you can see that it does actually initially move for the first few ticks, before it stops all X and Y movement and just falls on Z
[2017.01.10-23.54.28:373]Explode_Throw_C_5 - got force X=-1993.614 Y=-153.283 Z=-44.795 applied [2017.01.10-23.54.28:373]Explode_Throw_C_5 - Pos X=-3060.249 Y=-408.965 Z=192.741 [2017.01.10-23.54.28:381]Explode_Throw_C_5 - Pos X=-3078.381 Y=-410.359 Z=192.214 [2017.01.10-23.54.28:390]Explode_Throw_C_5 - Pos X=-3094.992 Y=-411.636 Z=191.663 [2017.01.10-23.54.28:398]Explode_Throw_C_5 - Pos X=-3111.601 Y=-412.913 Z=191.045 [2017.01.10-23.54.28:407]Explode_Throw_C_5 - Pos X=-3111.601 Y=-412.913 Z=190.977 [2017.01.10-23.54.28:416]Explode_Throw_C_5 - Pos X=-3111.601 Y=-412.913 Z=190.820
Where as the one before it keeps going:
[2017.01.10-23.54.26:307]Explode_Throw_C_4 - got force X=-1985.258 Y=-242.294 Z=-6.573 applied [2017.01.10-23.54.26:308]Explode_Throw_C_4 - Pos X=-2971.250 Y=-648.023 Z=193.060 [2017.01.10-23.54.26:316]Explode_Throw_C_4 - Pos X=-2987.792 Y=-650.042 Z=192.901 [2017.01.10-23.54.26:324]Explode_Throw_C_4 - Pos X=-3004.333 Y=-652.060 Z=192.675 [2017.01.10-23.54.26:333]Explode_Throw_C_4 - Pos X=-3023.328 Y=-654.379 Z=192.326 [2017.01.10-23.54.26:342]Explode_Throw_C_4 - Pos X=-3039.866 Y=-656.397 Z=191.955 [2017.01.10-23.54.26:352]Explode_Throw_C_4 - Pos X=-3060.559 Y=-658.922 Z=191.383 [2017.01.10-23.54.26:361]Explode_Throw_C_4 - Pos X=-3079.135 Y=-661.190 Z=190.784
Thank you for the sample project. The issue appears to be with the static mesh component simulating physics. I noticed that you specifically set the movement component's gravity scale to 0.0 and turned physics on for the mesh. If instead you set the scale to 1.0 and turn physics off, you will get the same behavior as the working projectiles without the mesh being blocked. This is also true for the first person template project. The arc of the projectile is controlled by the projectile's velocity and gravity scale rather than physics.
answered Jan 13 '17 at 02:21 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here