Forum rules - please read before posting.

How can I block a character facing one direction when Idle

Hey!

Currently I have set up a Player which has 'head turn towards hotspot' enabled. Everything works well except that I have set up Idle_L and Idle_R to be the same as the Idle_DL and Idle_DR sprites (for aesthetic reasons, I don't want a fully side on idle)

However with the head turning function turned on, when the engine is in Idle_L for example, the head turns completely backwards, which looks broken when the Idle_DL 

Here is a visual example of what I mean
https://i.imgur.com/LzXyNz2.jpg

Can I completely remove Idle_L Idle_R or set a limiter on the head turn movement on that angle so it doesn't turn around. 

I had a look at possibly using sprites unity complex bit I am not sure if it will fix my problem.

 

Comments

  • It's generally recommended to rely on Sprites Unity Complex whenever you want a character to animate in a custom way.  Don't be put off by the name, it's still simple - and more "best practice" so far as working with Unity goes.

    For completeness though, the "max head spin angle" for sprite-based characters is fixed at 100 - but you can change this if you really want by opening Char.cs, and looking for the "100" in the line:

    targetHeadAngles.x = Mathf.Min (targetHeadAngles.x, (animEngine.isSpriteBased) ? 100f : 60f);

    (Around line 3043)

  • edited June 2018
    Thanks! I tried doing what you said, and it did help a little, but still has issues at some positions on the screen. The head turning is great on all other directions, just that specific instance. 

    Is there anyway I can just remove Idle_L and Idle_R  from ever triggering? This would fix my problem 100%  Am I able to do this with sprites Unity Complex? Is there a tutorial out there on how to start a character using that, or will I have to reverse engineer one of you prefabs for it?

    EDIT: 

    Seems like adjusting that number makes it behave not that great.  Ideally I need to remove triggering of Idle_L and Idle_R. Will I be able to do this with Sprites Unity Complex?
  • edited June 2018
    DUPLICATE
  • With Sprites Unity Complex, all "automatic" animation is played back only via parameters that you allow AC to control.  It's down to you how you make use of that, but the intention is to allow you to animate things however you like.

    In that mode, there is no concept of "_L", "_R", but instead a parameter that is synced with your character's facing angle.  If you don't want a character to face left/right, just don't have animations that only play when facing at those angles.

    A Sprites Unity Complex variant of the 2D Demo's player character can be found in /AdventureCreator/2D Demo/Resources, and an example that incorporates independent head-turning can be found on the Downloads page.
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.
Do NOT follow this link or you will be banned from the site!