|
Ok two questions, Is there any while loops, or something similar, so i can do certain things while in a specific state? For example for the wall jump i want to say // while(touching wall) { Pause for a second then drift slowly down } otherwise gravity is normal // But anything I try the character will drift slowly down after touching the wall then moving to the side and not actually being on the wall. Second question. If i want him to jump off the wall, if there a better way then changing the horizontal velocity? I only want him to move about 5-10 'units' away from the way then hold normal horizontal velocity.
(comments are locked)
|
|
for your first question, you want to use a coroutine. for your second question, you want to interpolate from one position to the other using Mathf.SmoothDamp.
(comments are locked)
|
(comments are locked)
|
|
I suppose my greatest question is how does Mathf.SmoothDamp work? I looked it up but cant figure it out http://unity3d.com/support/documentation/ScriptReference/Mathf.SmoothDamp.html don't post questions or comments as answers. use the 'add new comment button'. It screws up the ordering of posts, and it doesn't read linearly. not to mention it messes up search results. SmoothDamp eases one value to another at a specified speed. It requires a reference to a velocity variable so in order to make it happen. There's not really more to tell, that's all it does.
Jun 22 '11 at 03:26 PM
testure
(comments are locked)
|
|
mathf.smoothdamp looks goood, but I cant seem to figure out how to make it work. Does that just keep returning a value that i set to his x position?
(comments are locked)
|
