Jumping Issue..(SOLVED)
LOL somehow typing out my question led me to answer it on my own, but I will still post this with the hope that maybe it could help someone else i guess!
Yay! more Newbie Questions...
I wanted to remove the possibility (for now) of players jumping off of vertical walls or in mid-air after dropping off of a platform, So I built my jump routine as follows.
Jumps=Actor Attribute (Integer)
Jump (key)
-Accelerate at 90 degrees with value 600
-change attribute "Jumps" to 0
Fall
-IF actor Linear.motion.Y < 0
-change attribute "Jumps" to 0
Land
-IF Actor Linear.motion.Y=0
-change attribute "Jumps" to 1
This works fine for testing at first but after running around and jumping for a while it eventually breaks and the actor will not jump anymore.
SOLUTION: apparently "Actor Linear.motion.Y < 0" was too tight a tolerance... changing the 0 to -10 solved the problem immediately.
Warning to self and others... this setup will cause the actor to be unable to jump while running down slopes, although there may be a happy place around "Actor Linear.motion.Y < -100" that will still work.
I know you all would have answered that for me so theoretical thank you's all around!
Grim
Yay! more Newbie Questions...
I wanted to remove the possibility (for now) of players jumping off of vertical walls or in mid-air after dropping off of a platform, So I built my jump routine as follows.
Jumps=Actor Attribute (Integer)
Jump (key)
-Accelerate at 90 degrees with value 600
-change attribute "Jumps" to 0
Fall
-IF actor Linear.motion.Y < 0
-change attribute "Jumps" to 0
Land
-IF Actor Linear.motion.Y=0
-change attribute "Jumps" to 1
This works fine for testing at first but after running around and jumping for a while it eventually breaks and the actor will not jump anymore.
SOLUTION: apparently "Actor Linear.motion.Y < 0" was too tight a tolerance... changing the 0 to -10 solved the problem immediately.
Warning to self and others... this setup will cause the actor to be unable to jump while running down slopes, although there may be a happy place around "Actor Linear.motion.Y < -100" that will still work.
I know you all would have answered that for me so theoretical thank you's all around!
Grim
Comments
I guess my alternative to collision rule jump resetting has its own fun flaws
http://www.jamie-cross.net/?portfolio=gamesalad-recipe-004-advanced-platform-character-movement-featuring-double-jumping
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
I had tried the above method of using the linear Y velocity rather than collide rules because in my first build the collide rules kept breaking and ending up with 0 jumps to use while standing on the floor. Also i wanted to try it partly because in the template I am building for myself all vertical and horizontal walls are the prototype actor. I understand that it would be pretty easy to just redo the walls but I wanted to try something else because I kept ending up with 0 jumps left.
In the end it was probably me just missing something since I had not at the time read your great tutorial
Thank You!