When I place an actor in the world, it behaves as shown in the first section of the video, but when i spawn it at run time from my character blueprint, it behaves the way shown in the second section of the video. I am using spawn actor from class, and am not changing any physics properties when spawning. It happens both with and without applying the impulse, and even when it is set to only collide with the landscape.
It looks like the center of mass is messed up in the spawned actor. Could you take a screenshot of the spawned actor’s origin by pausing the game and selecting it?
It weighs 100kg, and I’m sure it does as my character struggles to push it
It looks like it weighs nothing.
It is weird…
I know, I’ve never seen anything like it! I’ve even tried setting all the values at run time do with with physics and collision, but nope! Still the same
Can you share more information on your model, ie does it have a physics asset? Is it just a static mesh? And where is it being spawned, if it overlaps with your player on spawn and you don’t have your physics set to teleport then it will carry the velocity from you player.
Sure, it’s just a static mesh, so no physics asset. It just has simple collision that I’ve added within UE4. I’ve tried it both with spawning it directly in front of the player (possibly overlapping) and then adding an impulse to move it away from the player. I’ve also tried it spawning 500 units in front of the player with no impulse. Where it spawns in front of the player, it falls to the ground correctly, but then shows the exact same behaviour, as does spawning it at the player location with impulse.
Hmmm, it has to be in one of two areas, either the collision mesh of your static mesh. If your shelf’s collision mesh is set up weird you can experience some strange behaviors, try giving it a simple box collision. If that doesn’t, work try messing with your collision presets, chances are it’s colliding with something it shouldn’t, try just keeping one collision channel on. I wish I could help more, but I’d need to see a bit more of your set up.
Thanks, I’ll try it when I get to my PC later, I’ll give the simple box collision a go, I’ll cycle through each collision channel too, just to see what it’s colliding with incorrectly, the only thing I don’t understand is the face that if I just drag and drop the actor into the level, it’s absolutely fine.
Is the colliding element (be it collision box or the mesh itself) the root of the actor?
At the minute, the static mesh is the root, but I’ve also tried it with a scene component root to no avail
Could you show the hierarchy of the actor that is misbehaving?
Just to clarify, you’re expecting this behaviour rather than the very weird floaty shelf:
A simple actor:
Spawned from class by the Pawn.
Perhaps if you list what is done differently at your end, we can arrive at the offending element.
I’ve finally fixed it! Even though I had the mass set to 100kg, I just thought I’d give it a try at overriding the mass at spawn, and this worked! Thank you!