Hello!
Here’s my problem! I have a ground that I tagged as “Ground”, so if you are not on the ground, player could not jump.
Now … I wanted to make my enemy jump so I thought i could use some “jump points” and so I did!
Created empty objects, tagged as “JumpPoint” and inserted this on my enemy script:
public void OnTriggerEnter2D(Collider2D collision)
{
Debug.Log("Collision with: " + collision.tag);
if (collision.tag == "JumpPoint")
{
enemyRb.AddForce(new Vector2(enemyRb.velocity.x, enemyJumpForce));
}
}
That “Debug” says: groundgroundgroundgroundgroud… and never “JumpPoint”. So my enemy never jumps!
Where’s my mistake this time? ![]()
![]()
As usual, thanks for your precious help!
P.s.
Yes! I am sure I tagged jumpPoints! ![]()