Hello guys!
I’m developing a top-down shooter and have implemented a feature where shot enemies leave decals on the walls behind them. However, I’m encountering an issue where the decals spawn not exactly behind enemies. It seems that the problem is related to the rotation of the forward vector.
To handle damage, I use Event Hit → Apply Damage. To determine the decal’s placement, I use Line Trace by Channel, projecting the forward vector from the point of bullet collision with the enemy (hit location) to locate a wall for the decal. However, the vector does not consistently shoot in the intended direction — it’s different everytime I shoot enemy. Bullet has no gravity and go forward with constant speed.
This is how “projectile look for” wall behind enemy
This is how character shoot
I have followed several tutorials on YouTube, which work well for first-person shooters. I suspect the issue might be related to the top-down camera perspective, but I’m not sure.
Attached screenshots illustrate the variability in vector deviation, often slightly to the right or left, and consistently downwards, sometimes significantly.
Thanks!