Jump to content
loodakrawa

SpriterDotNet.Unity

Recommended Posts

I can verify this. Not all animations in the art packs are designed so they can be tweened with any other animation in the character's set. Animations like walk, idle, and run are likely to blend well, other animations you need to either just pop directly too create a custom animation that tweens from one to the other.

Share this post


Link to post
Share on other sites
1 hour ago, ThunerSkelett said:

I followed all the steps which where required and in my Folder Controller,canvas and pelvis are missing can someone maybe help me?

Often people think they're taking all the necessary steps but are actually missing a step or doing it wrong. To get help faster you might need to record yourself doing the entire process so people can spot what's going wrong.

Share this post


Link to post
Share on other sites
19 hours ago, Mike at BrashMonkey said:

Often people think they're taking all the necessary steps but are actually missing a step or doing it wrong. To get help faster you might need to record yourself doing the entire process so people can spot what's going wrong.

Maybe i am doing something completly wrong if a Video is really needed i can also do that

Share this post


Link to post
Share on other sites
4 hours ago, ThunerSkelett said:

Maybe i am doing something completly wrong if a Video is really needed i can also do that

Hopefully, someone else will have insight, as I'm not a Unity user...at least not so far. The only thought I have so far is to make sure you're not using the skin feature in Spriter, as that's not supported by any Spriter API including SpriterDotNet for Unity.

Share this post


Link to post
Share on other sites
On 10/22/2017 at 7:18 AM, ThunerSkelett said:

I followed all the steps which where required and in my Folder Controller,canvas and pelvis are missing can someone maybe help me?

Are all of your images imported as Sprites and not Textures?

Share this post


Link to post
Share on other sites
18 hours ago, loodakrawa said:

You should be able to see it in the image properties. More about it here: https://docs.unity3d.com/Manual/class-TextureImporter.html

Also, check if there are warnings in the console. SpriterDotNet will complain about missing sprites

I can now drag the .prefab into the game and if i start the game i see the Animation.

The Problem is i can't acces the file for the  Animation anymore i checked on the example there it is  the same what could be the reason for that?

4.JPG.6fc03a748e546d92d16c75191cc326bf.JPG5.thumb.JPG.6f82ccc279ca139dbfc708b47e05cbe2.JPG

Share this post


Link to post
Share on other sites
On 10/25/2017 at 1:55 AM, ThunerSkelett said:

I can now drag the .prefab into the game and if i start the game i see the Animation.

The Problem is i can't acces the file for the  Animation anymore i checked on the example there it is  the same what could be the reason for that?

 

What exactly do you mean by "i can't acces the file for the  Animation"?

Share this post


Link to post
Share on other sites
7 hours ago, ThunerSkelett said:

All the Animation i made shouldn't thei be in the .prefab ?

It generates a distinct prefab for every Entity in your .scml file and each prefab has all the animations of the associated Entity. I still don't understand what your issue is - but hopefully this helps. If you still have issues - try first reading the SdN documentation and the Unity Specific documentation and then, if you still have an issue, explain it in detail here.

Share this post


Link to post
Share on other sites

Hi there

I tried using your plugin in order to import my spriter character

But I'm not getting the controller nor the prefab I think I should get

I have currently a single entity with several animations

image.png.afebf1abdd8f5d74b0e01d16d3477a2b.png

But, when importing to unity following the steps on your git, this is what I get

image.png.8b2cb81fc9aa43c49450c313f16ff102.png

Dragging the char prefab gives me nothing

image.png.6f0bb408f00a32cbc57d128e2c223ae0.png

And I have no controller.prefab as well

I previously used Spirter2UnityDX, which, worked perfectly, but given your plugin seems to be more complete, I decided to try yours and looks like I'm doing something wrong

Thanks for the help

 

Edit: And I feel like a complete idiot

 

I just saw that, my character is behind the background. Just need to move it to the front

 

Sorry for bothering

Share this post


Link to post
Share on other sites

 

18 hours ago, CJX3M said:

 

Glad you fixed it - and don't worry, it happens to all of us :-D

Adding this here for future reference.

If you can't see your animation, check the following:
1) all the images are imported as Sprites
2) your animation game object has a normal scale
3) your animation game object is not hidden by something in the front

Also, the Controller is just a very basic example of how to control the animation, it does not get generated when importing .scml files. It's also worth noting that SpriterDotNet isn't integrated with the Unity's animation system and therefore needs to be controlled programmatically - hence the Controller in the example.

Share this post


Link to post
Share on other sites

Hey, I have another issue

I think I-m getting the hang of working with your plugin. I was just getting the hang of using the animator when I decided to switch to your plugin, so please, bear with me.

I think I'm doing all correctly, but I'm not getting my animations swapped

As shown in my spriter file, I have 6 animations 

image.png.afebf1abdd8f5d74b0e01d16d3477a2b.png

Which are correctly present in the UnityAnimator object

image.png.9d9892d057a8d125ce2852a377c1055a.png

image.png.438768b1c4c9f4ae8265776cddad603f.png

So, I check that my character is in the ground and the move is different than 0 to trigger "Walk" or equal to 0 to trigger "Idle", but it's not doing so

image.png.c75ed559f1a6f14a2f8b0f21e882c109.png

image.png.d0f8948a93e9606e93b9cd6e133dbbe8.png

Any idea what am I doing wrong????

image.png

Share this post


Link to post
Share on other sites

Not sure without debugging but I suspect your move is not actually zero. Checking floats for a specific value should be done with an epsilon not with an actual equality check.
Something like:

const float EPSILON = 0.001f; // basically a small threshold

if(Math.Abs(move) < EPSILON) {
  // trigger Idle animation
}

If that's not it - just debug it.

Share this post


Link to post
Share on other sites

Well, I will give it a try, but, the thing is, its not even changing to the walk animation, it's stays on idle.

I did expose the move variables in order to see if its changing, which it does.

I'll add some trace to the console in order to see if it's entering to the conditions

Thanks!

Edit:

Well, the epsilon didn't helped much. Actually, it was the transition time

I don't know if its set on millisecond, but I think it was quite high. Setting it to 1f worked for me, but pretty sure it will give me trouble in the near future.

Any way, I got it to work as well with the jump and fall down animations, even as to make the fall to play from any state, and that's awesome, but now, I'm trying to achieve the following

In my list of animations, I have a couple i want to use, startJump and landJump.

startJump should happen from the moment the player press the jump button, no issue there, but now, I want to add the vertical force for the character to jump at the end of the animation and so the jumpUp and fallJump animations plays

I achieved to do the following

image.png.d5c929d241277a44f77599fc9408ff05.png

It works perfectly, but, as you might imagine, the AnimationFinished event keeps on triggering, over and over again, so the character is jumping constantly

Tried to remove the eventHandler, but to no avail

image.png.b0b16cdccd5edf251a790c82e64a73e4.png

Any idea how to achieve my desired result. I was thinking on using blend, I still need to try that, but any advice would be pretty much appreciated

Edited by CJX3M

Share this post


Link to post
Share on other sites

Hi

I am new user and I think , I miss somethink :(

I watch a video in youtube about this plugin and I did samething but I have 2 problems ,firstly  I can see many GreyGuy's animations in spriter but I don't see them in unity.is this normal ? and How can I change the animations ? can I change animations with your code or must I write code ?

Here spriter animations window and in unity,GreyGuy and no animations :( 

vJAJmR.png

Share this post


Link to post
Share on other sites
2 hours ago, poewang13 said:

Hi

I am new user and I think , I miss somethink :(

I watch a video in youtube about this plugin and I did samething but I have 2 problems ,firstly  I can see many GreyGuy's animations in spriter but I don't see them in unity.is this normal ? and How can I change the animations ? can I change animations with your code or must I write code ?

Here spriter animations window and in unity,GreyGuy and no animations :( 

 

Hi
You can't see them because they are not listed. You're supposed to control them programmatically. You can use the code from the example to see how certain things are done but that alone won't get you far. For everything else - read the docs and try the examples.

Share this post


Link to post
Share on other sites
On 11/9/2017 at 3:00 AM, CJX3M said:

Any idea how to achieve my desired result. I was thinking on using blend, I still need to try that, but any advice would be pretty much appreciated

For the vast majority of animation management - you usually want some kind of state machine. I highly recommend reading about it here.

Share this post


Link to post
Share on other sites
13 hours ago, loodakrawa said:

Hi
You can't see them because they are not listed. You're supposed to control them programmatically. You can use the code from the example to see how certain things are done but that alone won't get you far. For everything else - read the docs and try the examples.

Thank you for answer .Now I can change animations but I can't find event system.For example,I have a fire animation and after starting 0.5 seconds, I want add a event trigger for using InstantiateBullet function.How can I do that ? In spriter , I can add a point but the other things :( Can you record a video about this problem for everone after that can you can immobilize the first message

 
 
 

 

Share this post


Link to post
Share on other sites
10 hours ago, poewang13 said:

Thank you for answer .Now I can change animations but I can't find event system.For example,I have a fire animation and after starting 0.5 seconds, I want add a event trigger for using InstantiateBullet function.How can I do that ? In spriter , I can add a point but the other things :( Can you record a video about this problem for everone after that can you can immobilize the first message

 
 
 

 

Once again - the docs and examples are your friend.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...