I’m doing a 2D-Game with Unity iPhone, Player Movement works through a custom Movement-Script and a Character Controller. Movement works fine so far, however I’m not able to do collision detection! I placed a cube-collider in the map, and added the following method to my movement-script:
consulting the collision matrix in the documentation usually answers all questions.
And yes, sometimes that means you have to attach a rigidbody or something, even though it makes no sense and the only reason is to enable collision detection.
thx for the reply tom.
I already read the collision-matrix part of the manual, but didn’t get the solution, though… I went through the 2d-Gameplay-Tutorial in the Resources section, and they get this work w/o a rigidbody… I also skimmed through the related script but couldn’t find the solution anyway…
I’ll check if it works with rigidbodies but I’d rather avoid them because of the iPhones limited resources.
I’d be very thankful for any further suggestions!
thx in advance,
moritz
Nailed it! Omg finally I can smoke a cigarrette and go to bed…
Collision Detection and so on is absolutely possible without rigidbodys. My problem was, that I moved my Player using transform.translate(movementvector).
However, this method ignores all collision stuff so I had to move the Player using controller.Move(movementvector) # (the controller variable contains my character controller)
the hardest tasks always have the easiest solutions.
…and this, dreamora, would explain why my collision detection only works if i use the character controller’s move-method, because only then the intern rigidbody is “collision-aware”.