Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by Kai_Gil · May 07, 2013 at 11:30 AM · spritetranslateorthello

Animating sprite resets its transform position after being moved

Hi folks. I'm using transform.Translate(Vector3.up * variable); to move an AnimatingSprite object in world coordinates. The object is part of the Orthello 2D framework. The sprite animates through 8 images that I've published into a cocos2D sprite atlas.

My JS code is written so that when I press the space bar ("Jump") the sprite moves (+m,0,0). However every time the sprite has moved in one frame, the next frame sees the sprite reset back to its initial coordinates (0,0,0). My sprite is being one stubborn fellow!

I thought this might have to do with the animation script, but I don't know Orthello 2D well enough to understand how it cycles through the sprite atlas images.

Do I need to tell the sprite something else in order for it to remain at its newly translated coordinates? Should I make a new function that isn't Update to handle this?

JavaScript - my sprite moving code

 var m : float = 1;
 var obj : Transform;
 
 function Update () 
 {
     if(Input.GetButton("Jump"))
     {
         obj.transform.Translate(Vector3.up*m);    
     }
 }



Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kai_Gil · May 07, 2013 at 11:27 AM 0
Share

I found this same question being asked!!

http://forum.unity3d.com/threads/165566-AnimatedSprite-with-Orthello

I'm not sure about the answer the above link gives, so I'll search further and report back.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Kai_Gil · May 07, 2013 at 12:55 PM

I can answer my own question woohoo!


" Orthello controls your position and ignores your physics. You should be able to solve this by setting your sprite.physics (in editor) to 'rigidBody' or 'NoGravity' ( after next patch also when sprite.physics = 'custom' ). "


This sorted it out, I just needed to change the Physics option in the Animating Sprite Component to Custom.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Sprite sheet not visualized correctly 0 Answers

Sprite movement is jittery/laggy 1 Answer

How to fix smooth edges on sprites? 1 Answer

How to Get Image edge size 2D?? 1 Answer

Rendering overlapped sprites w/ Alpha channel applied to background ones. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges