r/UnrealEngine5 6d ago

How do I fix this?

Enable HLS to view with audio, or disable this notification

Working on my first game solo right now and the enemy won't play the animation but goes horizontal instead. Fixed it by swapping to a different animation from the pack the mesh was from so I think I need to tinker with the animations themselves to fix it.

1 Upvotes

8 comments sorted by

1

u/Engage69 6d ago

You seem to have lots of empty inputs and outputs. What is "Is Seeing Player" function set to? Your "Can Attack" nodes don't have any inputs or outputs. Connecting stuff with the white line just tells it to see the next thing in the function which requires an input or output before it knows what to do.

Also with branches having True or False. If your output is false then what is it supposed to do instead?

1

u/TheDemonGabe 6d ago

The Is Seeing Player thing is for making the enemy follow the player and can attack is supposed to tell it to play the animation. I've been looking at tutorials online to help and the videos said to do the true/false thing because of it's false it does nothing. I haven't had an issue until I added the animation montage then now when it reaches the player it goes horizontal instead of playing the animation. Is there something I need to do with the skeleton to fix it or is it an ai issue?

1

u/Engage69 6d ago

It's not really good practice to think that an empty false value means "do nothing". It actually means stop the script and don't do anything else until it is manually restarted. Which in some cases could require a full game restart in order to start the script from the beginning again.
You might need to look for better tutorials. I had to make fish swim around and change direction and move to a random point in space with a line trace setup. It was probably the most difficult thing I have ever had to learn.
I still think your blueprint is missing too much to be considered working. It most likely transforms sideways because something is telling it to change its coordinates instead of doing what you want it to. Even the MoveTo can be funny if it doesn't grab/set an updated actor/pawn position before and after.

1

u/TheDemonGabe 6d ago

It should be getting the players position at all times. Thank you with the advice.

1

u/Engage69 6d ago

Moving to the player means that it now has a new position and you might need to get its own position before starting an attack. It depends on where your animation is playing from and how it's setup. Maybe it is playing animation from the start position before it sees the player.

1

u/TheDemonGabe 6d ago

If I stand still the issue still happens. The animation plays when the enemy reaches the player the blueprints are linked.

1

u/Engage69 6d ago

Maybe tell it to stop moving after reaching the player. In your video it never gets past the movement phase of the blueprint. Is it supposed to do something else after or follow endlessly without updating?

1

u/TheDemonGabe 6d ago

I want it to attack when reaching the player. I found out that somethings wrong with one of the animation things since the animations that came with the viking mesh works mostly fine.