Search Unity

Physics Collision detection

Discussion in 'Editor & General Support' started by Sbach, Jul 7, 2011.

  1. Sbach

    Sbach

    Joined:
    May 18, 2010
    Posts:
    9
    Hey there.

    I'm trying to start a space game but physics is making me crazy.
    I hope someone could give me a way to do what I want because after a lot of tests, nothing is working like I want.

    Here is what I have: The player is in the spaceship A, and this spaceship is in spaceship B. The spaceship B is the reference point so he is always centered at zero coords but he is moving in the scene( the scene translates, not him). I'm trying to find a way to move the player inside A; A which is moving in B. The problem here is collision detection for the 3 objects.

    At the moment for spaceship B, i set it as a rigidbody and in a LateUpdate I translate ever objects in the scene by his position + his velocity, in order to let it at zero. It allows me to collide with scene objects. And for the player and spaceship A I don't know how to script them.

    Is there a way to do it ?

    I think i may put that on a pic. :p