Support Forum

Prevent AI From Walking on Top of Dynamic Rigidbodies

Hi there!

My character is throwing rocks at Rich AIs and sometimes the AI walks on top of it. I would like the AI to be able to collide with my rocks, but to never consider walking on top of them. The rocks are already on a separate layers than the floor. Oh and the player can also get below the AI itself :slight_smile:

How can I acheive this?

Here is a video showing my issue : https://youtu.be/OM_AwktjWLM

Sam

Let me know if you need more infos.

Hi

The RichAI has a raycast ground mask that you can adjust:

if you are using a CharacterController you can instead adjust the physics layer settings.

Hi Aron!

Once there is a rigidbody, I cannot set the raycast ground mask, so I removed the rigidbody from my AIs since changing the physics settings would prevent any collisions with the rocks while I still want my Ais to collide with rocks, just not walk on top of them.

Since I removed the rigidbody, I can no longer set the velocity to make push effects and dash effects. Is there a function or a way to set, add or multiply the velocity of the rich AI?

Sam

Hi

Is the graph covering the rocks? Do you think you could show a screenshot of this?

Ah, in that case you probably want the rigidbody.

Hello :slight_smile:

Here is a screenshot of the graph and the rocks and an AI on top of it :


Its a bit difficult to see everything with all those gizmos.

The rock setup :


The AI :



There is another collider on the AI. This is the one that currently collides with the rocks :

So the collider on top of the AI is the one that can only collide with the ground and the other one child to the ai gameobject can collide with the rocks.

Sam.

image