UCC player character make dynamic rigidbody fly if pushed to wall

Hi,

I have a UCC player setup and it can push dynamic rigid bodies around, but the problem is that the player can push a dynamic rigidbody through a static collider without any resistance.

How can I fix that?

Edit
--------
The wall collider was not set to static I am sorry for this confusion. Now the dynamic rigid body sometimes doesn't go through the wall but instead fly in the reverse direction and it still sometimes go through the wall even after I set the wall collider to static.
How can I make the kinematic UCC player feel resistance and stop applying force in that situation.


Thanks for advance.
 
Last edited:
The character will apply a force to the Rigidbody and then it's up to Unity's physics system to hand the rest. Maybe you can increase the weight of the object?
 
Hi @Justin

Thank you for your reply and I am really sorry I was wrong in the original question. I did not notice the wall collider was not static. I fixed that.

Now the dynamic rigid body sometimes doesn't go through the wall but instead fly in the reverse direction and it still sometimes go through the wall even after I set the wall collider to static.
How can I make the kinematic UCC player feel resistance and stop applying force in that situation.

Thank you for advance.
 
Update:

I have setup a new empty scene with only a static ground and wall and dynamic rigidbody sphere and kinematic UCC character and things seems to work as expected. The character stops as expected when the sphere collides with the kinematic wall.

So it must be something with the complicated scene I have. I will check and update here again.
 
OK, so now I kind of understand what is the problem, but still looking for solution.
The setup for my character is a not standard.
The main character capsule collider doesn't cause this problem, the problem is caused by the box colliders which are a part of always equipped special big melee weapon.

1598877421129.png

The equipped melee weapon collider does go through the wall which kind of explains why dynamic rigidbodies fly away randomly or go through wall.

1598877517633.png

How can I make UCC treat the melee weapon colliders just like the main capsule collider?

I tried to move the colliders from the melee weapon into the colliders gameobject of the character and changed the layer from subcharacter to character, but they are still not treated as part of the character so they do penetrate walls.

Thank you for advance.
Your help is greatly appreciated.
 
Box colliders are not supported by the character controller for locomotion. You'll likely want to use the layer masks to have the box colliders not cause a collision with those objects and instead use the melee weapon.
 
Box colliders are not supported by the character controller for locomotion. You'll likely want to use the layer masks to have the box colliders not cause a collision with those objects and instead use the melee weapon.
I am not sure I understand the solution you are proposing.
What layer masks should I use?
Which objects do you mean? Do you mean the wall? I need collision with the wall.
Can you detail a little your proposed solution.
 
The melee weapon colliders will only be enabled when the melee weapon is attacking. The force will then be applied to the object. Under the layer mask field for the melee weapon you should specify the layer masks that it can collide with.
 
Since the weapon is an integral part of the character, the use ability is always activated so the colliders are always activated.
1598966888848.png
Do you mean the impact layers by the layer mask field for the melee weapon?
Am I looking in the wrong place?
1598967226987.png
 
I can change that weapon so that it's not an item and just part of the character but then the box colliders are not supported by UCC as you mentioned.
So having it as a weapon that is always in use and always equipped is one solution but still the weapon's colliders easily penetrate the wall with no resistance. Your help is greatly appreciated.
 
The weapon will always penetrate the wall if you get close enough no matter what layers you have set. The Third Person Item Pullback ability is used to prevent the weapon from clipping with the wall. Beyond that you can either increase the radius of the capsule collider, or get different animations that don't have the weapon extended so far out.
 
Those colliders should be considered as part of the character. The extension there is by design so it's a requirement.
So given the information you have explained setting it as an equipped item is not an option.
So I considered not setting them as an item, instead moving them under the colliders gameobject to be part of the character, but as you said the box colliders are not supported.
What collider types are supported for the character that I can put under the colliders gameobject?
How many colliders can I have under the colliders gameobject?

It's a little bit of limitation. Imagine a spider character for example that I want to setup colliders for each leg rather than a big capsule collider.
 
You can have an unlimited number of colliders that detect collisions, but they have to be a capsule or sphere collider.
 
Top