r/unity•
squigs

2D obstacle avoidance

Newbie Question

As a learning project, I'm creating a simple 2D, 2 player combat game. Each player has a plane and the idea is to shoot the other player and not crash into things.

What's the best way for the computer player to determine if it's about to crash into things? Ideally I think I'd like to know how close a fixed length line gets to specific objects.

Should I simply create a collider in front of the plane, or is there a nicer way to do this?

Posted Oct 11, 2023, 2:25 PM UTC

13

No comments yet

Nobody commented on this post, or the comments weren't captured.