Hi, I’m using sidescroller sample. How can I make objects fall on my character’s head and bounce on it instead of going through it?
Hey,
What objects are you using and what are the collision settings set to? You could make the objects Physics Actors under the collision setting, that will have them fall and react to gravity, hit the player and fall to the ground.
-W
Thanks for the hint. MyCharacter had Collision Presets set to Pawn and disabled “Collisions Enabled”, I just had to change it to custom preset and and then “Collisions Enabled”.
The rest of the objects now collide with my character even when they’re WorldDynamic or PhysicsBody. But there is one bad thing with this solution (bad in my case), can you help?
In my game each object has it’s own Vector3 gravity, so I can control if it falls down, flies up or sideways. Player can just control whether object falls down normally or has “inverted gravity” and flies up. Example setup:
- Character with “No Physics Collision”. Player shoots platform - it flies up. Player can walk around that platform with no problem.
- Character with “Collisions Enabled”, same thing but platform’s rotation get’s affected by mass of character. Clumsy player falls off platform:
Of course I understand that this is how physics work. But can I apply these two into my character:
- Things that fall on character should not ignore it’s collider (bounde off, not intersect)
- Set Character’s mass to 0kg (?) so Its collider couldn’t affect other objects as described above.