Hi, i have a problem.
I have a player, he Can hide in closet (when player interact with closet, I'm changing the player position to under ground and changing camera to be inside closet).
When enemy don't chase player, it works fine. But when enemy see player and player wants to hide in closet, enemy is running to this closet and standing there... I know, he knows the last player position, when he stands in front of closet. That's fine. But i'm trying to change this enemy's Move AI Mode to Flee from Player, changing Player faction to "Enemy", but enemy is still have in "Target Combatant" my Player. I'm using "Change Movie AI Mode" in my "Hide in Closet Event".
What Can I do? How to delete Player from enemy's target? I want my enemy to stand in front of closet, and when he don't see player, he just go away and hunting again.
Please for help :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Use a Destroy Object node (Add > Game Object > Game Object) to destroy the game object and a Spawn Player node (Add > Game > Player) to spawn the player.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
This image shows Move AI Component when i'm hiding and after unhide. I don't know why the enemy just stop and don't do anything.
https://imgur.com/a/cmr8FXS
Hide event looks like this:
Block Player Control/Camera/Input -> destroy object "Player(Clone)" -> Play Sound "HidingSound" -> Change Camera Rotation and Position to "InSofinerCamPoint" -> Show dialogue with "E - stop hiding" button -> click on button = Unblock Player Control/Camera/Input -> spawn player
If the player is destroyed, the player is out of range of everything, so only allowing the move AI within a certain range of the player will fail - disable using range to prevent this.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I disable Using Range in Movie AI in Battle System > Battle Settings and in Real Time Battle Settings. When i'm hiding and enemy don't see me - it's working. But when I'm hiding and he saw me before, he just stand in one place and his animations don't start.
What else I Can do with it?
So he needs to explore waypoints by default, then he chases the player when in view (sounds like that part works already) and then have an idle behavior when the player isn't seen anymore to go back to exploring waypoints.
That's my guess. Essentially the AI doesn't have anything to do other than hunt the player.
I make a lot of Events for Idle Behaviour, but nothing works. I use Change Move AI Mode, Change Move AI and others. I can't find something like "Is Player Avaible" or something. I don't know which step I need to use to check if player is seen, Can you help me find it?
I'm sure that Change Move AI worked... I think. When I'm hiding in closet, enemy stand in place, but when I'm unhide, the enemy just flee from the player, so something works. But now there is a problem - he stand in place, when player is hiding. And this is the worst :P
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
However, you can also solve this in your current version by setting the move AI's target with the waypoint mode:
- add an actor that finds all MoveAIComponent components (e.g. within a defined range)
- use a Set Move AI Target node using the Waypoint movement mode on that actor (the target object can be ignored in that case)
Best set the move AI target after a small wait after destroying the player, e.g. following the camera position change.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
After hiding in closet, the enemy goes to Waypoint. He Can now hunt player if he see him.
Another question - how Can I tell my enemy to go back to following waypoints? Or to follow other group of waypoints? I try to use "Set Move AI Waypoints" with MoveAIComponent, but nothing happend. Is there a way to do this?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!