Hi guys, I'm developing a mobile game where player moves to the x direction just by velocity. And I'm having a little problem. When velocity going too high, player's collider not triggering the enemy triggerenter event because player cannot be seen because of it. How can prevent that? How can I move too fast but still seen and trigger the event?
It didn't work. And if I disable Trigger and use colliderEnter then I can't get through the object. it just collides and stays.
Ah I'm sorry, I forgot that Continuous collision doesn't work with triggers. You could try doing your own checks each FixedUpdate using Rigidbody.Cast to sweep the player's collision shape in front of the player by their velocity and detect what they will overlap in the next movement. https://docs.unity3d.com/ScriptReference/Rigidbody2D.Cast.html
It worked that way but I have another problem. I just wanna trigger once but player gets through the object it triggers multiple times.
I'm not sure the exact reason that's happening, so it may be possible to fix the duplicates occurring. But in any case, would it be a simple solution to disable the trigger after it is detected the first time?
The senario is that I have an object and it has health, I want to go through that object multiple times but in this case, when I'm getting through that object collision happens all the time when player is in the object that's why it happens multiple times. I just wanna detect collision enter but raycasthit2d doesn't have anything like that or I couldn't findt it.
[SOLVED] I made it rigidbody kinetic and disabled the trigger while enable use full kinematic contacts for both player and object. collision works that way and I can go faster, detect collision and get through the object.