Unity Community


Page 63 of 89 FirstFirst ... 1353616263646573 ... LastLast
Results 1,241 to 1,260 of 1772

  1. Posts
    3
    Quote Originally Posted by sim88 View Post
    3.4.2, thanks I will try with the newest and I'll let you know
    Yes, apparently the problem was caused by the outdated version. Thanks

  2. lix lix is offline

    Posts
    1

    Animation does not work due to automatic diabled ExSpriteAnimation

    Hi,
    I have Ex2d v1.2.5 (120510), I created a new scene, animation worked at first, after some further development and I did not pay attention to the animation, but now, it is not working anymore. the reason is during game running, the ExSpriteAnimation is deactivated automatically, if I pause and activate again and then run it, again it will be deactivated. it happens to all animation with ex2d. it happened before, what I did to fix was to delete all the ex2d generated files and start from beginning, luckyly it was still small work. I need to know where to look and how to fix. I checked all my scripts, there is nothing about disabling the exSpriteAnimation component.

    I did also sync and build all, atlas as well as animation. In the old scene where it copied from, the animation still working.
    Is it possible it is due to frequent crash of unity ?


  3. Posts
    4
    Thankyou for reply.
    I found a way that is to put exSpriteObject in Hierarchy by tool and duplicates it.
    I can make the 10 Sprites now.

    However , I am having a issue yet.

    if possible, please teach me following questions.

    I'm using exSprite and using textures in it.
    However, I want to use a part of texture.

    For exsample.

    ExSprite is setting a 1204x1024 texture.
    I want to draw it to clip the texture to cut (32,32,48,32).

    I tried it.
    For exsample.
    1:change the elements[0].trimRect
    2:exSprite[i].trimTexture = true;
    exSprite[i].trimUV=new Rect(0,032,32);

    However, It draw the all area of texture.

    How should i change the parameters?
    Best regards.
    Last edited by Sinichi; 06-09-2012 at 02:11 AM.


  4. Location
    Russian Federation
    Posts
    13
    Quote Originally Posted by Sinichi View Post
    I'm using exSprite and using textures in it.
    However, I want to use a part of texture.

    For exsample.

    ExSprite is setting a 1204x1024 texture.
    I want to draw it to clip the texture to cut (32,32,48,32).
    Hi.

    Don't you know about this tutorials?
    http://www.ex-dev.com/ex2d/wiki/doku.php
    I hope this one would be helpful for you
    http://www.ex-dev.com/ex2d/wiki/doku...eate_soft_clip

    Regards.


  5. Posts
    48
    Hi everyone, i'm having a hard time using the setframe feature. I have the latest version of Unity and ex2d.
    First I start my animation playing....
    then when I want it to stop, I want it to display a certain frame from the animation so i use this code:

    spAnim.SetFrame(top, 1);
    spAnim.Stop();

    However, for a split second the original default sprite will flash and then it will display the one I set in the SetFrame...am I doing this completely wrong?

    thank you!


  6. Posts
    704
    Quote Originally Posted by lix View Post
    Hi,
    I have Ex2d v1.2.5 (120510), I created a new scene, animation worked at first, after some further development and I did not pay attention to the animation, but now, it is not working anymore. the reason is during game running, the ExSpriteAnimation is deactivated automatically, if I pause and activate again and then run it, again it will be deactivated. it happens to all animation with ex2d. it happened before, what I did to fix was to delete all the ex2d generated files and start from beginning, luckyly it was still small work. I need to know where to look and how to fix. I checked all my scripts, there is nothing about disabling the exSpriteAnimation component.

    I did also sync and build all, atlas as well as animation. In the old scene where it copied from, the animation still working.
    Is it possible it is due to frequent crash of unity ?
    Hi lix,

    It depends on your wrap mode and the stop function. Basically, if you stop the animation, the animation component will turn to disable. You can use exSprite.spAnim get this animation back instead of use GetComponent<exSpirteAnimation>() which is slower.


  7. Posts
    704
    Quote Originally Posted by Sinichi View Post
    Thankyou for reply.
    I found a way that is to put exSpriteObject in Hierarchy by tool and duplicates it.
    I can make the 10 Sprites now.

    However , I am having a issue yet.

    if possible, please teach me following questions.

    I'm using exSprite and using textures in it.
    However, I want to use a part of texture.

    For exsample.

    ExSprite is setting a 1204x1024 texture.
    I want to draw it to clip the texture to cut (32,32,48,32).

    I tried it.
    For exsample.
    1:change the elements[0].trimRect
    2:exSprite[i].trimTexture = true;
    exSprite[i].trimUV=new Rect(0,032,32);

    However, It draw the all area of texture.

    How should i change the parameters?
    Best regards.
    Hi Sinichi,

    Like zafod said, you can use exSoftClip. Recently we developing exClipping for our new GUI framework. The exClipping is almost the same as exSoftClip but it use shader process clipping which allow you rotate the sprite in the clipping rect.


  8. Posts
    704
    Quote Originally Posted by trothmaster View Post
    Hi everyone, i'm having a hard time using the setframe feature. I have the latest version of Unity and ex2d.
    First I start my animation playing....
    then when I want it to stop, I want it to display a certain frame from the animation so i use this code:

    spAnim.SetFrame(top, 1);
    spAnim.Stop();

    However, for a split second the original default sprite will flash and then it will display the one I set in the SetFrame...am I doing this completely wrong?

    thank you!
    Hi trothmaster,

    You should stop the animation first, then set the frame. Other wise the stop function will reset the animation if the StopAction is DefaultSprite. So your script will looks like this:

    Code:  
    1. spAnim.Stop();
    2. spAnim.SetFrame( top, 1 );


  9. Posts
    48
    Quote Originally Posted by jwu View Post
    Hi trothmaster,

    You should stop the animation first, then set the frame. Other wise the stop function will reset the animation if the StopAction is DefaultSprite. So your script will looks like this:

    Code:  
    1. spAnim.Stop();
    2. spAnim.SetFrame( top, 1 );
    Thank You!!

  10. Super Moderator
    Location
    Great Britain
    Posts
    9,650
    Question please:

    How do I set the Anchor dynamically on a sprite?

    Tried: newParticle.sprite.anchor = Anchor.botCenter;


    but anchor isn't a property of exSprite even though its exposed and everything in the editor..
    Currently working with Sony on our new
    PS4 and Vita game in Unity!

    This post is not representative of Simian Squared Ltd


  11. Location
    Curitiba - PR / Brazil
    Posts
    275
    @jwu

    Can i use the uv mapping of ex2D, without using the ex2D Component? I have been using Batching Tools to make sprite of 3D Objects and reduce drawcalls, but he generate many Mesh and I animate some 3D objects textures, by change the mesh in real time.

    What i want to know is: Can i get the tilling of one sprite frame?


  12. Location
    USA
    Posts
    97
    Hi, I was wondering if anyone had the problem I have. I create an animation and attach it to a game object > I test the game > game object only animates if it's selected in the Hierarchy window AND in the Inspector window, the Ex Sprite (Script) section is visible. If I hide this section, the game object won't animate. If I spawn the game object during game play, this isn't a problem, but if it's in the Inspector window by default, nothing.


  13. Posts
    704
    Quote Originally Posted by hippocoder View Post
    Question please:

    How do I set the Anchor dynamically on a sprite?

    Tried: newParticle.sprite.anchor = Anchor.botCenter;


    but anchor isn't a property of exSprite even though its exposed and everything in the editor..
    Hi hippocoder,

    Can you send me the problem package, I test this and it works perfect here.


  14. Posts
    704
    Quote Originally Posted by badawe View Post
    @jwu

    Can i use the uv mapping of ex2D, without using the ex2D Component? I have been using Batching Tools to make sprite of 3D Objects and reduce drawcalls, but he generate many Mesh and I animate some 3D objects textures, by change the mesh in real time.

    What i want to know is: Can i get the tilling of one sprite frame?
    Hi badawe,

    Yes you can. It is saved in exAtlas.elements[i].trimRect. So if you have exSpriteAnimClip, and get the frame, you will know the atlas and index that frame used, then use it get the trimRect. The trimRect will including the uv information that you need.


  15. Posts
    704
    Quote Originally Posted by amaranth View Post
    Hi, I was wondering if anyone had the problem I have. I create an animation and attach it to a game object > I test the game > game object only animates if it's selected in the Hierarchy window AND in the Inspector window, the Ex Sprite (Script) section is visible. If I hide this section, the game object won't animate. If I spawn the game object during game play, this isn't a problem, but if it's in the Inspector window by default, nothing.
    Hi amaranth,

    Can you give me more details. The animation you create is it a Unity animation or exSpriteAnimation ? If this is an Unity animation, you need to enable animation helper in exSprite inspector. If other problem, can you send me a package or give me some snap shot ? Thanks in advance.

  16. Super Moderator
    Location
    Great Britain
    Posts
    9,650
    Hi jwu, could the problem be I am using unity js? I have too many deadlines to spare much time to create example, so I try this weekend to get something to you.

    Error was Unknown identifier 'Anchor'. (meaning the enum couldn't be found, which is fairly impossible to achieve unless it doesn't exist on js).
    Currently working with Sony on our new
    PS4 and Vita game in Unity!

    This post is not representative of Simian Squared Ltd


  17. Posts
    48
    Hi jwu, thank you again for helping with my problem the other day, I have another question maybe you can help with...
    I am using a perspective camera. I have "use pixel Perfect" checked on my sprites.
    i'm "looking down the y axis" to sprites that are rotated 90 degrees so they face the camera.
    objects move on the xz axis.
    What I want to do is this:
    give the illusion of depth with a 2d background image. LIke old adventure games.
    Like in this picture: http://agsarchives.com/gamecard/882/...quest-iv-5.jpg
    If the character walks "below" the other characters his sprite will render in front of them, if the character walks "above" the other characters his sprite will render behind them.

    Here is my attempt to do this by moving the object on its Y axis. It works GREAT with the orthographic camera, but I want to use the perspective camera to add 3d effects that don't work in orthographic. Any suggestions? Thank you!
    Code:  
    1. baselineobjectY = baselineobject.transform.position.y; //the y position of object1
    2.    
    3.   if (baselineobject.transform.position.z > transform.position.z) // if object1 z axis is > this objects z axis {
    4.         print("baselineobject is above!");
    5.         transform.position.y =  baselineobjectY + 1;     //move this object Y position + 1 above the object1 y position
    6.          }
    7.      else if (baselineobject.transform.position.z < transform.position.z)
    8.         {
    9.         print("baselineobject is Below!");
    10.         transform.position.y = baselineobjectY - 1;
    11.        
    12.          }


  18. Posts
    48
    Never Mind I figured out how to do it!
    set all the 2d objects to a new layer called "2dObjects" and then add a 2nd camera that is orthographic and set its culling mask to the new layer of 2dObjects. then set its "clear flags" to depth only and it will project the 2d objects onto a 3d perspective background!

    EDIT *** I also seem to need to add a 3rd camera for another layer "ontop" or in front of the 2d layer....hmm is this the best approach to this???
    Last edited by trothmaster; 06-12-2012 at 04:22 PM.


  19. Posts
    704
    Quote Originally Posted by hippocoder View Post
    Hi jwu, could the problem be I am using unity js? I have too many deadlines to spare much time to create example, so I try this weekend to get something to you.

    Error was Unknown identifier 'Anchor'. (meaning the enum couldn't be found, which is fairly impossible to achieve unless it doesn't exist on js).
    Yes, if you are using the javascript, please put the ex2D Core in the Plugins folder, that will make sure your javascript compile after it.


  20. Posts
    704
    Quote Originally Posted by trothmaster View Post
    Never Mind I figured out how to do it!
    set all the 2d objects to a new layer called "2dObjects" and then add a 2nd camera that is orthographic and set its culling mask to the new layer of 2dObjects. then set its "clear flags" to depth only and it will project the 2d objects onto a 3d perspective background!

    EDIT *** I also seem to need to add a 3rd camera for another layer "ontop" or in front of the 2d layer....hmm is this the best approach to this???
    Well, it depends on your game. If this is a pure 2D game, I would use exLayerMng and allocate a dynamic layer block. In your case, the 3D environment only affect in background. So nothing bad here.

Page 63 of 89 FirstFirst ... 1353616263646573 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •