hi, i’m trying to create all the logic for my game’s ai, i’m having a small issue.
i’m using the fps c++ template, i have used some functions in c++ for my player but i’m coding my ai with blueprints.
so far i have created a patrol behavior, my ai can see and hear the player, but the problem is when the ai must fire to the player pawn, the ai fires but the projectile doesn’t collide with the player, i have already checked the hit and overlap events on the player and the projectile but without any results.
i have created a copy of the projectile blueprint from the fps template and i’m using it as the bullet for my enemies.
any ideas on what i need to do to fix this problem ?
You player is usually with collision behavior set to Pawn, so your projectile have to be able to collide with Pawn as well.
You should be able to change that in defaults mode or component mode while select your collision shape.(for FPS it’s a capsule)
the collision of the projectile is set to “projectile”, also if i used that projectile as a bullet for the player pawn it can damage the ai’s pawn, very weird thing, because it collides with the ai but no collides with the player’s pawn.
then check your player pawn’s setting and make sure it collide with projectile.
also, make sure it generate hit event on both to be safe.
the next thing i would check is if projectile’s OnHit event has any specific check that makes it does nothing to your pawn class.(ie, when a hit event generated, if your project can also overlap and not blocking pawn, it can go through and generate overlap event)
the hit and overlap event on the player are triggered for static meshes and the level geometry, the problem is the projectile.
on the projectile side i have the both event “hit” and “overlap” event with only a “print” node to check if the projectile is colliding with something, i saw yesterday night that when the projectille will overlap the player it says that is overlaping or touching the level floor.
very weird thing, i try to create another projectile using the tutorial from the youtube to create a simple blueprint projectile and was the same, the projectile not collides with the player.
okay, from your screenshot, you can see that you have collision enabled greyed out and set to “No Collision Enabled”.
So, I checked my 2 projects. One is using UFO fro example, so static mesh is root, and set to “Physics Actor”, but in another one using third person template, capsule have a “Simulation Generate Hit Events” which is not in your screenshot.
I don’t know why, but can you make sure your capsule is root component for your pawn?