#detect collision wo rigidbody2D (physics)

1 messages · Page 1 of 1 (latest)

finite harness
#

Hi im a beginner, so I didnt want to over complicate my learning by adding physics when my game doesn't require it anyways. How can I still detect collisions/overlapping of sprites in a 2d game?

glossy ivy
#

Raycasts and other manual collision checks. Or just use a RigidBody2D which is infinitely easier than making your own collision detection system

finite harness
glossy ivy
#

There are multiple different kinds of casts you can use. But you'll just be recreating the collision detections yourself pretty much, so you are much better off using a RigidBody2D

finite harness
#

Ok, and I can deactivate physics by setting the body to kinematic? Ok thank u. I guess I have no choice but to use physics

glossy ivy
#

You can set the gravity scale to 0 so it isn't affected by gravity. But for unity's physics messages you have to use a non-kinematic rigidbody

finite harness
#

detect collision wo rigidbody2D (physics)

glossy ivy
#

Also you will probably want to actually use the rigidbody for movement rather than moving the transform directly so that it actually collides with things correctly, since using the transform sort of ignores collision

finite harness
#

I see. (I was hoping there was a way to move without using physics. But everywhere on 1st page of Google said it is done with rigidbody. I suppose it only slightly tedious, but otherwise okay.) Thanks for all the information.