Forum rules - please read before posting.

NPC will not face correct way on scene load

Hi,

I have my NPC with correct IDLE_L image ready for page load, but on scene load my character is always set to IDLE_U, the IDLE_L is set to default in animation panel, and the correct sprites are loaded in to the relevant animation. Any ideas as to why?

Comments

  • is the marker facing that direction? or the direction you want player to face. it may be using that.

    does the player still work, i.e. move around?

    do you have a navmesh, and is it set as the default one for the scene (in scene tab of AC)?


  • Hi,

    NPC doesn't have a marker that he is set to, the player is standing still but turns to face the player in a conversation and then turns back to what should be left idle but instead turns to up idle?. And the navmesh is fine and set to default.
  • And sorry to be a dum dum, but how do you post a screenshot on here?
  • try uploading it to a image holding website such as imgur, or photobucket etc., and paste the link here.

    how does the animator look. (double clicking it in the editor window - shows all the animations inside) - are all the right ones there, with the corect name?

    and that animation definatly created, and has the right sprites inside it ?
  • Hi, yep all looks fine. Double and triple checked the animator, and animation.

    Check out screenshots here:

  • NPCs will start a scene facing downwards, but you can easily change their direction by calling the "Character: Face direction" Action within your "On start" Cutscene, as listed in the Scene Manager.
  • Hi, it still doesn't seem to override it, and whatever I do my NPC starts on IDLE_U even though it is definitely IDLE_L in my sprite renderer? 
  • The specific sprite you place in the Sprite Renderer is ignored once the game begins, because the Animator takes control over it.

    Changing the character's facing direction once the scene begins is the correct way to do this.  Please post a screenshot of what you've tried so far.
  • Can i add:

    Can you check if the right names are listed in the npc script of the npc :P
  • I apologise for the continued trouble with this.

    I was referring to the Action that you've placed in your OnStart cutscene to change his facing direction.  I also don't recall seeing your NPC inspector - you've got the correct name (ChladniIdle) in the Idle animation field?

    One other thing to check is the actual state of the Animator when the game is running.  Double-click on his controller (in his sprite) when the game is running to bring up the live instance of his Animator.  Is it playing the Idle_U animation in there?
  • HI, 

    I have the correct name in the idle animation field, i assume by this you mean in the "Idle name: ChladniIdle" in the Standard 2D animation field in the Root of the NPC?

    On a seperate note, I have now animated my NPC across a path, and when he is walking down he appears and goes through his animations, but when he walks up he disappears, yet when i watch the scene in the Scene panel he is visible walking down and up? 
  • Plus he still starts on a Up position for a second and then adjusts awkwardly into his downward walk before disspearing on his up walk?
  • I think we'll be going back and forth forever if we're just going by text descriptions of what's going on.  Only thing for it is to see it myself - please PM me a .unitypackage file of the prefab + animations / animator controller / anything required by the asset and I'll take a look.
  • Here is a video which might help, if not I will PM you a.unitypackage as requested.
  • I have put the unity package in there too
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.