Forum rules - please read before posting.

[2.5D][Sprites Unity Complex] Mesh Renderer Plane based Player

edited September 2014 in Technical Q&A
I've got a 2D character rendered using several mesh renderer planes.
The character uses mecanim to animate movements

The bird npc in the 2D Demo sorta matches my character just not using sprite renderer.
Ok just tried out sprites unity that stopped the whole angle situation,
walk animation isn't running and the pathfinding doesn't work like mecanim, character keeps getting closer to camera

walk animation working on Sprites Unity Complex,
but still have issue with pathfinding
think the pathfinding issue was to do with the camera

right now i've got the transform based animations working with "Sprites Unity Complex", (working with blend tree transitions)
but don't know how to take the direction information from ac and use it to flip the character

using frame flipping in "Sprites Unity" works but the animations don't transition or animate right

Is there more documentation on "Sprites Unity Complex"?

Comments

  • Sprites Unity Complex merely outputs AC variables (direction, speed etc) - it's up to the designer to use them however they wish.  Frame flipping, being an automatic feature, is not available with this method.  However, frame-flipping is merely a case of applying a (-1,1,1) scale to the sprite - an Animation Event script attached to your FSM should handle be able to handle this.
  • edited September 2014
    thanks,

    for some reason the character gets rotation values set from AC? when i set transform.localScale = new Vector3((float)neg,1,1); ?

    (didn't know how to use the animation event thing)



  • I don't understand your question.  AC will adjust the sprite's rotation to make it face the camera, if that's what you mean. If you need help running animation events, I recommend asking on the official Unity forums.
  • yea the path or player script keeps setting the sprite child scale back to 1 whenever i change it... :(

    setting the player scale z(???) to -1 works but it messes with the z order of the sprites

    Player script- Animation engine: Sprites Unity Complex
    Sprite child- uses plane meshes (not sprite renderers)

    I feel very silly not being able to sort this out
  • edited September 2014
    ok so it is the player script,
    created a flip parent game object for the sprite child

    when setting the flip, the sprite child CAN(when you click around like crazy) pick up rotation values that offsets it usual facing the camera rotation

    isPlayer2D ?
    option to limit rotation values on the sprite child ?
  • Are you using a SortingMap in your scene, with a FollowSortingMap script attached to your sprite child?  That could be the cause of your scale of 1.  In 1.39, this is changed: the root GameObject will be scaled instead - that may eliminate the issue.

    As for your second post, what do you mean by picking up rotation values?  Do you mean that the sprite child is (briefly) not facing the camera by accident?
  • edited September 2014
    no sorting map, i forgot to change the 2D title to 2.5D, (my bad)(2D mode changes my character prefab to top down after hitting play for some reason(Unity 2D)Not(Top Down))

    2.5D everything works as long as I don't flip the character when I get a new direction value from ac

    screenshot

    scaling the navmesh to a very thin width helps,


  • edited September 2014
    well works in 2D now, forgot that the player script 0s out rotation, and its a plane that is flat by default..
    also don't get any z fighting issues in 2D

    but it was only happening in 2.5D when I flipped the character so...
    the screenshot shows the code that is used to flip

    edit---
    i assumed it would,, rotating the parent to the sprite child doesn't work after I hit play
    edit---
    set line 1323 char.cs to 270f for rotation,, worked, but realizing that 3d planes and 2d will not go together... (no order in layer etc.., but I can't use a polygon collider in 2.5D so i don't know what I should do...)
    edit---
    line 1304 was what preventing me flipping the character
    edit---
    what should I set to have 2.5D treat navmesh as 2D polygon collider
  • You can't use a Polygon Collider in 2.5D mode.  The whole idea behind 2.5D mode is that the characters move in 3D space, yet the backgrounds are still 2D.  Unity's Polygon Collider is a 2D-only tool, so it won't work here.
  • I understand,

    in the next update
    could you add a bool for usesFrameFlipping so

    !flipFrames doesn't set -spriteChild.localScale.x

    -(-1) back to 1 :(

    i'm not a code person so this small thing was a big deal for me
  • There are very good reasons as to why things are the way they are.  It's fine you're not a coder, but I need to know why you want things changed.  What exactly is the issue here?  It really would help your case if you could post screens to demonstrate the problem.
  • my player is 2d but uses 3d physics, ( because hes rendered to multiple flat planes)
    there is no UI option to flip him in Sprites Unity Complex, so I take the direction info from ac
    and flip him by setting -1<->1 whenever direction changes left<->right
    except the value I set is set back here lines 1304->1307 in Char.cs

    if I had the option to disable uses frame flipping then !flipFrames<->flipFrames wouldn't effect my character

    I don't know what else this is connected to through out your project
    but my players navigation works :)
  • Thanks for the explanation.  It should be fine, in this case.
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.