Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Let's say that I have two cubes. One cube is the player and the other is the floor. I am trying to make the player cube jump using the functions: "When a key is pressed do something" --> "Key S" --> "Action" -> "Execute JavaScript" That is, I want to make my character jump using JavaScript instead of the prebuilt in jump functions. I also want to know how could I reuse the same code, make some slight changes to make my character fly at will? Thankshttps://www.ambiera.com/forum/images/submitquick.png |
||||
|
go through this post... Xanimalking has made a behaviour for jumping by tweaking the script provided by me.... https://www.ambiera.com/forum.ph... |
||||
|
Just_in_case, I was trying to make my character fly with this code below. The code below is something that I found on this forum a long time ago. But, I don't fully understand how it works - I'm sorry, I'm kind of an intermediate leveled programmer. But, I'm not very advanced yet.
I use the "U" key to make my player go up. But, when I release the U key via the "if key is pressed do something ---> if key is let up" scenario, my player just stays in the air and doesn't go down. Thus, how do I fix the code above to make the player go down. It seems like it could be something simple. But, I don't know what it is. |
||||
|
to make it go down create a when key left up set value to Camera1.CanFly or Camera1.AffectedByGravity False or True |
|