Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 /
avatar image
0
Question by cAyouMontreal · Dec 08, 2011 at 08:50 AM · itweenlocalshakecoordinate

[iTween] ShakePosition and local coordinates

Hi all, I've some issues trying to shake an object in local coordinates with iTween. Indeed, I've an object attached to my camera, and this camera is rotating around my scene. I wanted to use ShakePosition to shake this object, but it seems that "islocal" just doesn't work, because my object move from Screen to a strange position (World coordinates?). If I stop rotating the camera around, everything is fine.

My code:

 Hashtable wrd1 = new Hashtable();
 wrd1.Add("amout", new Vector3(2,0,0));
 wrd1.Add("islocal", true);
 wrd1.Add("time", 1f);
 iTween.ShakePosition(aText.gameObject,wrd1);

aText is my 3D object attached to my camera, and this script is on the camera.

Any solution? Thanks a lot !

Comment
Add comment
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

5 Replies

· Add your reply
  • Sort: 
avatar image
14
Best Answer

Answer by Lttldude · Apr 30, 2012 at 11:37 PM

I know this is an old question, but I had the same problem and found a fix if anyone out there has similar issues. You just need to make a minor change in the iTween.cs file.

Go to this function:

 void GenerateShakePositionTargets()

and change

 vector3s[0]=transform.position;

to

 if(isLocal)
 {
    vector3s[0]=transform.localPosition;
 }
 else
 {
    vector3s[0]=transform.position;
 }

Hope this helps everyone.

Comment
Add comment · Show 4 · 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
avatar image Brastik · May 17, 2013 at 06:31 AM 0
Share

This is awesome! I wish I could upvote this answer :D Thanks a lot, Lttldude

avatar image JohnAraujo · Oct 28, 2015 at 02:38 PM 0
Share

Great catch, thank you so much for sharing!

avatar image zer0w0 · Nov 23, 2015 at 10:20 AM 0
Share

awesome!Thank you very much!

avatar image FunFreighterGames · Sep 24, 2020 at 07:02 PM 0
Share

O$$anonymous$$G, thanks so much for that. surprised its still not fixed on iTween's end.

avatar image
0

Answer by sriram90 · Dec 08, 2011 at 12:53 PM

Hi cayou66 ,

try with this... i have used this already and worked well..

 iTween.ShakePosition(target,iTween.Hash("x",0.3f,"time",1.0f)); // target game object ... that is object you need to make shake.
                                                                                                      // x is axis here.
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
avatar image
0

Answer by cAyouMontreal · Dec 08, 2011 at 04:41 PM

Hi sriram90, I'll try but I'm pretty sure that it won't work.

It seems that it's just impossible to Shake and Move an object at the same time... I tried to modify the iTween function, without success...

I'll try also a custom function, without iTween.

Thanks !

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
avatar image
0

Answer by cAyouMontreal · May 01, 2012 at 01:13 PM

Wow that's really cool if it works ! You should contact the developer of iTween to tell him to fix this bug. Thanks !

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
avatar image
0

Answer by Mezzerzmith · Nov 28, 2012 at 02:54 PM

Hi I just had the same problem and solved it through putting the shaking on an empty gameObject, and when it shakes, add (make sure not to set) its X and Y shaking to the camera, then you can move at the same time.

Hope you get it to work!

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

9 People are following this question.

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

Related Questions

iTween - Increase shake over time? 1 Answer

iTween Shake intensity issues 1 Answer

Camera shake 11 Answers

How to allow movement during camera shake? (iTween) 0 Answers

Accessing local system ( File Browser ) 2 Answers


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