I have been trying to figure out why my mammoth doesn’t push away the player standing next to it when it turns (via Set Actor Rotation). I checked the collision settings for the mammoth and the player many times and made sure they were set correctly. I looked for help elsewhere and everyone thought it was weird (including me). It wasn’t until a few minutes ago when I did a test that I realized that capsule collision attached to a skeletal mesh would not work.
I see someone has the same problem as me, but no answerSetting actor rotation does not check for collision
I’m not sure if this is a bug in Unreal or if I’m missing something.
Note: The character controlled by the player is the third person template BP_ThirdPersonCharacter
It looks like you’re using the Character Actor and movement component. The Character Actor and movement components are hard-coded to only work with the main character capsule, and even that capsule doesn’t work particularly physically (it tries to stick to the floor, it tries to always stand upright, it tries to avoid ledges, and so on.)
If you want an object that works more physically, make that object be a subclass of regular Actor (or Pawn) and add a skeletal mesh component for the animation, and appropriate physics body components for the collisions. You’ll also need to write your own movement component, unless the default replicated physics behavior is good enough.
You mean, if I don’t write my own movement component, this phenomenon of two actors passing through each other is inevitable, right?
This is more like SetActorRotation not checking for collision. As you can see from the video above, collision and SetActorRotation are only checked when the player’s character is moving. When the player’s character stops moving, they will pass through each other.
Is there an easy way to stop this happening? I just want my mammoth to not clip the player with its butt when it turning.
Since my mammoth needs to turn to any angle, I did not use root animation and physical simulation. There is a curve in my Turn animation, which records the angle of rotation. So when I need my mammoth to turn, I will read the curve data in the animation and modify the mammoth’s rotation data in real time through SetActorRotation.
The Manny with the two extra capsule collisions was created for testing purposes, and it simulates this mammoth.
They will all pass through the player’s character.
The easiest solution that will work with the existing character setup, is to make the capsule covering the mammoth wide enough that it encompasses the tusks and the butt. You’ll also need to make it taller than the mammoth is tall, because the capsule must be upright.
If that doesn’t work for you, then derive the mammoth from Pawn, and make it simulate physics, and build a convex bounding box around it (or make it have three colliding bodies.) You will then have to somehow drive these bodies to make the mammoth walk, and also, not fall over. When you want the mammoth to turn, you should drive it with torques, and let the physics engine solve the outcome. When you want the mammoth to not fall over, you should drive it with torques, and let the physics engine solve the outcome. When you want the mammoth to walk, you should drive it with forces, and let the physics engine solve the outcome.
You can implement this physics control in the actor itself, or in a movement component for the actor. If your game is single player, either will work fine. If it’s multi-player, I recommend the movement component.
In general, when doing physics, “set position” and “set rotation” should be avoided, because they are inherently non-physical operations, and no realistic physics system can react correctly to those operations. Probably for this reason, Unreal has decided to not even try, because it can never be good, so why spend any effort at all? (I’m guessing at motivations here.)
This sounds very complicated, I’m not sure if physics simulation will allow the mammoth’s animations to work properly (such as turning, attacking, walking, running, etc.), the only place I use physics simulation right now is for ragdolls (when the character dies)
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.