Hello friends
@livid hollow and I need some help with collision detection between players and projectiles.
In summary, we can shoot properly and hit opponent players when they are close, but when they are abit farther away, the collision between the opponent and the projectile is no longer registered.
for the collision detection, we first check if the player that was hit is the owner of the projectile. If the player is indeed the owner, then we return.
If they are not the owner, this means they are an opponent player, then we deal damage, play the impact FX, and destroy the projectile(return to pool).
We tried to debug this by checking the object ID of the player that got hit against the network object id of the owner that spawned the projectile (playerthatgothit.owner.networkobject.objectid).
When the casting player and the target player are close, the values would be different, and therefore the projectile impact would work.
However, past a certain distance, the values would no longer be different.
The network object ID of the player getting hit would be the same network object ID as the player that spawned it, eventhough that should not be the case as they are different players.
This is also the case for AI objects. they can be impacted when close, but not when far.
Are we missing something?
Hopefully its something small 😭 😭 😭
I've attached a video of how this looks like in our game.
Thank you all for reading and for your help (: