Quantcast
Channel: Answers by "CallToAdventure"
Viewing all articles
Browse latest Browse all 48

Answer by Airship Games

$
0
0

i am 'answering' just to be able to add code formatting:

I am only a beginner in scripting so a lot to learn how to put things together. Naturally I missed a few things (not sure how to define the other variables in your example); This might be similar to another problem I have, maybe I will understand how transforming objects over time with variables like above (using time) or like in the next example: i am trying to rotate an object full 360 degrees without having to keep the button pressed; now I use:

var tumble = 360;

.... and in update function

if(Input.GetButton("Tumble"))

{
 transform.Rotate(0, 0, tumble*Time.deltaTime);
} 

Funny thing is I have both answers only they work each for the other question :) the behavior of the second example should be in the first one and the other way around. Bare with me here and try not to laugh too hard :)


Viewing all articles
Browse latest Browse all 48

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>