Discuss Scratch
- Discussion Forums
 - » Help with Scripts
 - » oh my god why
        
         
- MrFluffyPenguins
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
oh my god why
https://scratch.mit.edu/projects/449109232/
Holding the jump button on the trampolines in this platformer I'm making causes dumb stuff to happen. He jumps at a normal height, then goes much higher than he should. Can anyone help?
                        
                        
                    Holding the jump button on the trampolines in this platformer I'm making causes dumb stuff to happen. He jumps at a normal height, then goes much higher than he should. Can anyone help?
- thewalkman
 - 
                            
						
						
                            Scratcher
                        
						
						 
500+ posts
oh my god why
What if you made a variable called “if trampolining” that is set to “1” if the player is on a trampoline or in the motion caused by one? Then when the player is no longer affected by the trampoline, it switches to “0” again. When the variable is 1, the player's jump function could be disabled, and if it's 0, enabled.
                        
                        
                    - nicklosimn
 - 
                            
						
						
                            Scratcher
                        
						
						 
12 posts
oh my god why
I think that if you hold jump it will add the trampoline and you jump together
try to add this in the W key is pressed
                        
                        
                    try to add this in the W key is pressed
if <touching [ trampoline] ?> thentry that
set [ velocity] to [0]
end
- MrFluffyPenguins
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
oh my god why
I think that if you hold jump it will add the trampoline and you jump togetheri tried it before, didnt work
try to add this in the W key is pressedif <touching [ trampoline] ?> thentry that
set [ velocity] to [0]
end
What if you made a variable called “if trampolining” that is set to “1” if the player is on a trampoline or in the motion caused by one? Then when the player is no longer affected by the trampoline, it switches to “0” again. When the variable is 1, the player's jump function could be disabled, and if it's 0, enabled.ill try it
Last edited by MrFluffyPenguins (Nov. 20, 2020 14:05:37)
- MrFluffyPenguins
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
oh my god why
What if you made a variable called “if trampolining” that is set to “1” if the player is on a trampoline or in the motion caused by one? Then when the player is no longer affected by the trampoline, it switches to “0” again. When the variable is 1, the player's jump function could be disabled, and if it's 0, enabled.That works, partially, but it still lets the player go much higher if they hold the jump button.
- thewalkman
 - 
                            
						
						
                            Scratcher
                        
						
						 
500+ posts
oh my god why
Did you test it with the variable showing?What if you made a variable called “if trampolining” that is set to “1” if the player is on a trampoline or in the motion caused by one? Then when the player is no longer affected by the trampoline, it switches to “0” again. When the variable is 1, the player's jump function could be disabled, and if it's 0, enabled.That works, partially, but it still lets the player go much higher if they hold the jump button.
- TimeClox
 - 
                            
						
						
                            Scratcher
                        
						
						 
4 posts
oh my god why
I dontkknow
Last edited by TimeClox (Nov. 20, 2020 18:39:04)
- thewalkman
 - 
                            
						
						
                            Scratcher
                        
						
						 
500+ posts
oh my god why
Does your regular jump script state that the player has to be touching the ground?
                        
                            Last edited by thewalkman (Nov. 20, 2020 18:40:40)
- MrFluffyPenguins
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
oh my god why
the bug has already been fixed, i decided to use the thing where you can go higher as a featureI dontkknowHow will that fix the bug?
- Discussion Forums
 - » Help with Scripts
 - 
            » oh my god why 
         



