I set up the target lock on based on the video on YouTube, and for some reason instead of focusing on the enemy, it locks onto a wall, why?
The wall is the enemy.
Or something is wrong with the code.
what do you mean it’s the enemy? and how do I get rid of it?
You show us the code where you programmed “lock on target” system and maybe we find out what’s causing the issue.
I fixed it, but now it locks on on the wall or the enemy, so it’s a 50/50 chance
Hey there @TBLOPL67! Welcome to the community! From a high level, you’ll have to adjust your lock on system to only lock on to objects with a specific tag or a specific collision. Start looking at where you acquire your target in code, and think about what kind of check would make sense to implement. Without seeing your code no one here has enough information to help adjust it.
Posting code would help us get you to a solution. Sounds like running a check to determine if the acquired target is of a certain class(enemy) before locking onto it would be a good start. Ideally though whatever your using to search for/trace objects should ignore anything besides this class. For example f your running a line trace in front of the player, you’d want to setup a custom collision channel for enemies, and have the trace only collide with that channel. Hope this helps