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 /
avatar image
0
Question by S3TH · Feb 09, 2011 at 12:27 AM · itweenshakepositionshakerotation

iTween ShakePosition stalls forward movement?

I'm trying to use iTween's ShakePosition to add a camera shake effect. I have the camera parented to an object that is aligned to and moving along an iTweenPath. When I use ShakePosition it temporarily stalls the camera from moving forward while the shaking takes place and then resumes its movement, but is now trailing behind its previous position by several units. Multiple shakes in a row essentially stop the camera from moving anywhere at all. I'd prefer it if I could keep the camera held at its current position(that's constantly moving along the path) and perform the shake around that without stopping.

ShakeRotation has a similar effect except instead of falling behind it seems to be obtaining a final rotation that the shake uses to shake around and align to on completion. While shake is active it will stop keeping up with the current constant orientation until the shake is complete, at which point it resumes but with the new altered rotation.

Should I try to find a way to constantly update the vector3 it's performing the shake around?

Maybe I should just make my own camera shake..

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by pixelplacement · Feb 13, 2011 at 09:17 PM

iTween can't move two properties at one time. Try shaking a parented camera and have it's parent follow the path instead of trying to do it all on one transform.

Comment
Add comment · Show 1 · 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 S3TH · Feb 14, 2011 at 05:02 PM 0
Share

Thanks for the idea pixelplacement. I gave it a shot but it's sort of still having the same problem. I don't remember if it did this before but it's taking the shake settings and seems to be using them as world coordinates even though I set "space" to self. I already wrote my own shake transfor$$anonymous$$g localposition though so it's all good.

I'm still loving iTween. The pathing system is excellent. Will be donating. Thanks for the great pluggin.

avatar image
0

Answer by mrFox · Dec 18, 2011 at 12:40 AM

Hey there, i know it's an old question but i had the same problem so i found it and thought i might share the answer.

parenting is the solution as Bob Berkebile pointed out, but it seems that it only works the other way around.

drop the camera into an empty gameobject to parent it and then: let the child (the camera itself) follow it's path and shake the parent.

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 Lttldude · Mar 09, 2012 at 06:02 PM

I had the same problem: getting a gameobject to shake while using another iTween function (following a path or moving). The key is parenting. The parent does the movement while the child does the shake. However, I had to do some crafty update, onupdate, and oncomplete functions for it to work. Note: I only needed to have the child follow the parent's y position during the shake. Hope this helps.

 `function Start ()

{ iTween.ShakePosition(transform.gameObject, iTween.Hash("x",shakeAmount, "time", duration, "delay",delay,"easetype", iTween.EaseType.easeInOutQuint, "onupdate", "StayWithParent", "oncomplete", "StayWithParent")); }

function Update () { StayWithParent(); }

function StayWithParent() { transform.localPosition.y += transform.parent.position.y - transform.position.y; }`

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

2 People are following this question.

avatar image avatar image

Related Questions

iTween ShakePosition Question 0 Answers

Is it possible to move through itween path manually with a parameter except of time? 1 Answer

iTween oncomplete not firing 3 Answers

Play animation after iTween 1 Answer

Reuse iTween component for multiple small animations 0 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