Platform, not detecting collision when applying a translation

Hi, I’m curently making a 2D runner game. In order to solve some problems I had with my previous version, I made some modification. Instead of having my character moving on the X axis, it is my platform that are translating on the opposite direction. The problem is that when I do this, the platform doesn’t detect the collision anymore. Any ideas how to solve this problem? Thanks in advance.

If you are using “Translate” or “transform.position = newPosition” in your plataforms, they will not launch collision events.
You will have to use rigidBody.addForce or velocity for this.


My opinion about your “modification”, i think that moving all the plataforms instead of just one player is wrong, you will be moving a lot of physic bodies and using a lot of processing time for this. Maybe the previous version didn’t work because u was doing something wrong.


Thanks for the tip, you are probably right. I moved back to my old version, and try something else for the parallax.