Hello
Just simple as that i need to now why my mannequin stays in his IDLE animation if im in hes see pawn here my simple noob code:
Thanks
Hello
Just simple as that i need to now why my mannequin stays in his IDLE animation if im in hes see pawn here my simple noob code:
Thanks
try AIMoveTO instead of add movement input, of course that needs a navmesh
I try it with both it dont work…i have green field also navmesh
what result are you getting?
animations wont matter yet, add a prints string on the pawn sensing and see if that ever fires
yes i can see the text
Chat gpt gives me this bp
To create a basic enemy AI in Unreal Engine that moves in a specific direction when the player enters its field of view, you can use the Blueprint visual scripting language. Here is a basic example of such a Blueprint:
Create a new Blueprint for the enemy:
Open the created Blueprint:
Add a “Sphere Component” for the field of view:
Add an “AI Controller”:
Open the “Event Tick” node:
Add logic for enemy movement:
Here is a pseudo-code example of the Blueprint:
On Event Tick
Get Player Character
Get Actor Location (Player)
Get Actor Location (Enemy)
Calculate Direction (Vector between Player and Enemy)
Set New Position (Enemy + Direction * Speed)
You can also use a “Line Trace” to ensure that the player is in the enemy’s field of view before triggering movement. Experiment with the exact values and add more logic to customize the behavior according to your requirements.
When I try it like this it works the ai moves but i dont want that he follows me just go straitght in one direction:
you can use the destination then, get its forward vector and multiple it by how far you want to go, can repeat on success if you want
use get actor forward vector you wont need a rotation, multiple that by a distance, say 500 for testing, add the result to get actor location and put the sum into destination
i cant add a “multiple” on “get actor forward”
you multiply the return value, ie the vector, just change the pin node to a float
what result are you getting?
is the pawn not being sensed?
is the branch failing?
is the AI not moving?
is the location wrong?
hey auran THANKS A LOT for the try to help me!!!
The error that otherwise occurred was that it ran in the wrong direction
so you want the AI to move towards the player but only a set distance?
i think the aimoveto is trying to avoid the obstacle, does it work as intended without? if so you’d want a custom movement function
everything works now but thank you very much for try to help me
I posted the solution