I have a very large boss, with collision between the boss and player enabled.
Sometimes during the fight, the boss may accidentally fling the player far up into the sky when playing a misc animation and the player being too close to the animation.
I really want the collision to be active at these times, but want to avoid things like these.
Does anybody have any tips on what I can do to mitigate this behaviour?
Not sure what you mean.
Yes, the boss has a Physics Asset built from capsules and boxes, which are all blocking collision against the player. Parts of the collision are disabled during attack animations and such, with custom logic attached to overlaps instead. But during miscellaneous animations, I want the collision to be active, and the player is able to collide with the boss and even stand on parts of him.
The issue arises during relatively fast movements, if the player is hit by a limb during one of these animations, the risk of being launched away arises.
Well what do you you want to happen instead? If a physics-based boss’s giant arm hits a player i’d expect the player to go flying.
You can set the max depenetration velocity to prevent the player from flying away too fast. You can temporarily disable collision with the boss if the the character is penetrating. It really depends on the game.
Your proposed solution is kind of what I’d like; that when these unlucky launches occur - the player isn’t launched to oblivion, but the max velocity is set to a maximum. Will test this solution, thanks!
Seems quite similar to this problem… If so, best not to assume anything about the contact.
On a wholly different device / engine version, you might even get the opposite reaction etc.
So maybe better if you detect the hit or contact and assign a force that you want impacted…
(Intercept the hit + momentarily disable physics, then re-able physics with a force you add).
But all I want to do is clamp the max force applied to the player from colliding with the boss.
During actual attack animations I actually do disable collision and use overlap checks to fully customize the behaviour, my issue is with the miscellaneous animations.
Appreciate your input though!