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 :)
  • edited November 2018
    Try destroying the player's game object instead of placing it under ground.
    Post edited by gamingislove on
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ok. So when I spawn player again, he will have all equipped weapons and inventory? Which Game Event I need to use?
  • Yes, the player's state (status, inventory, equipment, etc.) isn't bound to the game object, so you can destroy or spawn it as needed.

    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 is not working :( So I delete player gameobject using Destroy Object when I'm hiding. Then I spawn player after unhide.

    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.


    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
  • Ah, yeah ... check the Move AI Range in Battle System > Battle Settings, or if this is in battle, in the settings of the battle system you're using.

    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!
  • Now the enemy just stand and do nothing.

    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?
  • edited January 11
    He can't flee from player if the player is deleted. So instead you need to set up a behavior where he goes back to patrolling/following waypoints whenever he's not hunting.

    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.
    Post edited by Wrofir on
Sign In or Register to comment.