Forum rules - please read before posting.

Unable to make the Sorting Map work with 3D Objects

edited July 2018 in Engine development
Dear community,
did any of you manage to make the sorting map scale objects without sprite attached? It was a new feature introduced with 1.59a if I'm not wrong. I am using latest Unity (2018.2.1f1) and latest AC, just upgraded for this purpose.

The followsortingmap component works well with sprites, in the same scene. I expect that if I attach the followsortingmap component to a Gameboject that has a mesh as child Gameobject, I should be able to make it bigger or smaller depending on the %values set in the Sorting map gameobject, referenced by the followsortingmap script. What happens is that as soon as I add the script component to the Gameobject (parent, or child), I cannot move the Gameobject anymore in the scene (i.e. if I try to translate the Gameobject using the gizmo in the scene, it won't move). I have also played around with the various checkboxes in the followsortingmap script, but nothing changed.

Again, in the same scene I have a character Gameobject with a Spine child object, which contains a mesh renderer -> and this works perfectly fine. 

Thanks for your time!

Comments

  • Ok I looked at the script FollowSortingMap.cs, and I realized that it would only work with <char> gameobjects. But I remember it was possible to apply the sorting map to all types of Sprites, long time ago. Or maybe I was dreaming?! 
    What would be the best way to scale an Object getting closer to the camera, using the clamp values of the sorting map? That's important, to give the right sense of perspective to each of the scenes, as not only players are moving, but also other objects!
  • edited July 2018
    When it comes to scaling, the Sorting Map has only ever affected characters.  However, you can have a sprite or any GameObject you like read the "intended" scale of a Follow Sorting Map component and apply it in a custom script.

    This can be done by reading the FSM component's GetLocalScale() method, i.e.:
    http://pasteall.org/1045653/csharp
  • edited July 2018
    Cool, thank you so much Chris! I must have dreamt it, in my wildest dreams then   :sweat_smile:  

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.