Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

[Help] Collision resolution without Physics2D

Discussion in 'Project Tiny' started by dogonwheels, Jan 10, 2019.

  1. dogonwheels

    dogonwheels

    Joined:
    Jan 10, 2019
    Posts:
    1
    I'm trying to add collision detection and resolution so my user controlled entity doesn't go through impassable objects. Naively I thought this would be done best by resolving collisions and moving the player back out of the object - or is this best done with ray casting/checking before moving the object?

    I realise that Physics2D likely handles all this - but I don't want physics/forces based movement for my player character and enemies.

    I noticed that the docs mention hit test results - https://docs.unity3d.com/Packages/com.unity.tiny@0.13/manual/module-hitbox2d.html#hittestresult - but I don't see which system would add these.

    Alternatively, how would I go about ray casting in Tiny? It feels like looping through all the world's objects in the movement code and manually checking would be against the spirit of ECS - happy to be wrong though! :D

    (I'm still pretty new to Unity, let alone Tiny, so forgive me if I've missed the obvious)

    Thanks.
     
  2. sebastianm_unity

    sebastianm_unity

    Unity Technologies

    Joined:
    May 3, 2018
    Posts:
    21