|
Post by kieneta on Jan 6, 2023 10:12:04 GMT
As you can see in the video, when I use this animation, the player ignores the wall collider. This problem also happens with the outside walls, that's why I added a bigger box collider next to the wall, but the player still enters the collider and then comes back. I decided to use recoil and I created another layer that is only used for recoil and it worked. But if I add this layer to the dungeon walls, it will be difficult to fight you because you will always touch the layer with recoil. I also noticed that in some cases I can push the enemy into the wall and then it comes back through the wall. I don't even know what the problem could be (animation, root motion, rigidbody). But I tried all the solutions I found but none of them helped me. rb and animator component
|
|
|
Post by Invector on Jan 9, 2023 13:23:18 GMT
We used the have this issue a while ago, are you using the latest version of the template? ps* don't forget to use the tags "Attack" and "LockMovement" on your state
|
|
|
Post by kieneta on Jan 9, 2023 18:53:06 GMT
I use melee combat template v2.6.2a. Also tags "Attack", "LockMovement" and "LockRotation" are on all the animations where this bug persists( Animator Tag). Or does the "LockMovement" tag have to be on the sub-state machine? At the sub-state machine there is only the "Attack" tag. You mentioned the last version of the template, could it be because I use another version of unity (Unity 2022.1.17)? When I first imported the template, I couldn't import the project settings, that's why I created another project on the Unity 2020 version, imported the project settings and copied the files to the project on Unity 2022. *Edit*:When I use roll, I don't go through walls, so the problem is only present when attacking
|
|
|
Post by Invector on Jan 12, 2023 21:59:16 GMT
Roll has a much slower speed, I think Unity collision can't handle high speed collision very well for our physics-based character controller when combined with root motion, you can try a few things:
1- Playing with the values Default Solver Iterations in the Physics values in the Editor > Project Settings > Physics 2- Make sure your mesh collider is big enough, try using the option carve or perhaps use a box collider instead 3- Make sure your Player Rigidbody Collision Detection is set to ContinuousSpeculative, you can also try the interpolate modes to see if it works.
|
|
|
Post by kieneta on Jan 13, 2023 10:00:37 GMT
Ok thanks, I fixed the bug. It's just that I did it my way, I did something like "Recoil" only for specific animations. I created a trigger in the animator "ForceExit" that interrupts the animation. I created a "Wall" tag and put it on the interior walls, and a script where I used OnCollisionEnter and check if I touch the wall with the "Wall" tag and use a concrete animation (I used vAnimatorSetBool), if all the conditions are true , then the animation stops forcibly. For the enemies (they entered the walls when we attacked them), I used the same method, only slightly modified. When enemies touch the wall with the "Wall" tag then they use "Roll". So once he has touched the wall, he cannot be hit again until he moves away from the wall. I apologize for wasting your time and I hope that if someone else encountered this bug, I helped them a little.
|
|