Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by John 1 · Mar 01, 2010 at 10:54 PM · transformtimescaleintervalshrinking

Gradually scale platform?

I want to have a platform that begins to scale to (about) 0 in width and length once the player walks on top of it, but I want the player to have enough time to walk past this platform before it shrinks completely.

Ignoring the code for the trigger event, how would I gradually scale this platform over some time interval t?

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

4 Replies

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

Answer by Eric5h5 · Mar 01, 2010 at 11:20 PM

var startScale = Vector3.one; var endScale = Vector3.zero; var t = 0.0; var speed = .5; while (t < 1.0) { t += Time.deltaTime * speed; transform.localScale = Vector3.Lerp(startScale, endScale, t);

 yield;

}

Comment
Add comment · Show 6 · 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 hizral84 · Jan 11, 2012 at 08:39 AM 0
Share

Hello there, this is interesting. would like to know more about this.

I can understand the "var startscale" and var endscale" this set the saiz from size A to B correct. Would like to know why "var startscale" used "vector3.one" and "var endscale" used "vector3.zero", whay does is set like that? can both used "vector3.zero"?

"var speed" is for the "time.deltatime" right, this is for he transtion speed on the "vector3.lerp" correct? but what is "var t"? and why is "t += time.deltaTime * speed" what does this line do actually?

and using "while" will scale the gameobject to the desire size would it? do we need to used "while" to have smooth transtion of the gameobject or there's another method?

in the "transform.localscale" why is there no "+" sign before the "=" sign?

thanks in advance.

avatar image syclamoth · Jan 11, 2012 at 08:51 AM 2
Share

Please don't dig up old posts to ask stupid questions. If you have basic program$$anonymous$$g questions to ask, go to google. If you have basic unity-specific questions to ask, use the search-bar at the top-right side of the page. If you still haven't found your answer, open up a new script file, and mess around a bit. If you still can't work out how it all fits together, or you run into a problem, then create a new question, and I'm sure somebody will be there to help you.

avatar image Lo0NuhtiK · Jan 11, 2012 at 08:52 AM 0
Share

lol       

avatar image hizral84 · Jan 12, 2012 at 01:49 AM 0
Share

Why yes, yes I am stupid. How did you know that. I did search google and used the search bar at the top right side of the page. I also did mess around a bit with the script. I did understand a bit, just would like to know more that is all. If the way I'm asking making you mad I apologize for that. But there's no harm done asking a question, tips, or guideance.

avatar image Lo0NuhtiK · Jan 12, 2012 at 02:05 AM 0
Share

$$anonymous$$aybe no harm done, and Unity3D specific questions are more-than-welcome here, but this Q&A forum isn't intended to serve as a basic program$$anonymous$$g tutorial session. Tips etc is given quite frequently here, I've seen, but this isn't the place to 'ask' for them.
Google should have yielded plenty of results for javascript.
W3Schools.com <-there's one of the many places you can learn scripting/etc basics.
I'm no expert, but I've learned every bit of the web-dev code and all other scripting that I know from w3schools, google searching, and a f**k-load of trial and error (as well as learning a lot here in unityAnswers in the passed month or so)
So you can't tell me you can't find any information in an online search for the questions you posted.

Show more comments
avatar image
0

Answer by jorgon · Apr 17, 2012 at 07:03 AM

Please: Why does my instanced prefab appear with my final scale and doesn't do gradually?. I can't write the yield instruction because I'm in an Update function, maybe this is the problem...What would you do with it?. Thanks in adavance.

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 RaveTZ · May 08, 2012 at 10:18 PM

LoONuhtiK, seriously. Who are you to dictate who can ask what? The search in google resulted in this page. What google showed me is that being a dick is the result of not being able to provide an answer. Sorry if the question was above your head.

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 RaveTZ · May 08, 2012 at 10:30 PM

Seriously? Who are you to dictate who can ask a question in a unity "Answers" forum? The search in google resulted in this page. What google showed me is that being a dick is the result of not being able to provide an answer. Sorry if the question was above your head.

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

6 People are following this question.

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

Related Questions

Object scale/rotation changes when parented to flipped object 0 Answers

I need a kinematic rigidybody to move colliders. What about scale/rotation? 1 Answer

how to scale object to fit inside a room 1 Answer

FBX importer transform scale (NOT the 0.01 issue) 0 Answers

Scale Transform Axes (Non-uniform) With Pinch 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