Hi all,
Sorry for this numpty question. I’ve tried to look around but not getting my head around the whole physics things.
What I want is for my player to be able to bump into and slightly move an enemy (ie just a small push) and if they are seen by the enemy to trigger events. I can get one or the other to work, but not both.
The player has a 2D box collider and a kinematic Rigidbody 2D
The enemy has a 2D box collider and a kinematic Rigidbody 2D
Enemies have a visible vision cone - a child sprite with its own polygon collider that is a trigger.
When the player enters the vision cone it triggers the event as expected. I can’t get the player and enemy to collide however, the player just goes over the top of the enemy.
I have another enemy that is patrolling and if I set the player to not be kinematic but with a gravity scale of 0 the patrolling enemy will push the player, but when I try and replicate the settings on the first enemy it’s not making a difference.
At present I’m controlling the character with http://wiki.unity3d.com/index.php/GridMove for the purpose of prototyping but would be writing the player movement myself shortly.
I believe it comes down to “if you’re moving using x you need to use physics y” and that kind of thing but I just can’t get my tiny brain around it at the moment!
Happy to supply codes or anything else as needed.
Thanks.