Rock projectile works when put into the level alone but not when spawned

(1st screenshot is player code, 2nd is the rock (Pawn))

when i drag this pawn into the level it works just fine, but when i spawn it its like it doesn’t exist to the ai, any suggestions on how to fix this?

(pawn code)

(Ai detection code)

Can you provide more detail?

“Rock not working when spawned” is funny and all :wink: but please explain what is wrong with it.

  • Is the projectile not spawned?
  • Does it not make a sound then bouncing?
  • Is it not being heard by the AI?

yeah that is fair, the ai isn’t hearing it is all. (sorry it was like 2am when i posted this. I was super not awake, my bad)

No worries :slight_smile:

…so the AI Perception works with two components:

  • AI Perception Component
  • Stimuli Source

The actor must be registered with the Perception System. Please, double check if your rock has a AIPerception Stimuli Source component and it is properly registers.

For more information check the official documentation.

Also note that there is a debugging tool that can be accessed with the apostrophe (`) and then Numpad 4. This will help you a lot figuring out what’s going on.

If the rock is a Pawn, it’s probably not being possessed by an AI Controller when spawned.
Make sure that in your rock pawn’s Class Defaults, Auto Possess AI is set to Placed in World or Spawned.

THANK YOU THIS FIXED IT (i feel kinda dumb now lol)