Sweetgebus Posted November 26, 2023 Share Posted November 26, 2023 Hello, I'm attempting to learn lua script and have been battling what I'm sure is a simple issue. I have my cube"Player" that I have made to be able to jump via key press. With the current logic, I can continue to press the key and the player will never hit the ground. I would like to be able to double jump and then wait for x amount of seconds before doing it again. I was looking into "Wait" but I'm not having luck with it either. Quote Link to comment Share on other sites More sharing options...
IceBurger Posted November 26, 2023 Share Posted November 26, 2023 Although I am on my phone and cannot provide any code snippets, I would recommend making a Boolean that is set to false when the player is touching the ground and true when the player jumps. Two of those booleans would allow a double jump (if one is set to true only when the other is true). Quote i now hate love C++ Beeeeeeeeeeeeeep~~This is a test of the emergency signature system~~Beeeeeeeeeeeeeep RX 6800XT | i5-13600KF | 32GB DDR5 | 1440p is perfect Link to comment Share on other sites More sharing options...
Josh Posted November 26, 2023 Share Posted November 26, 2023 You need this: https://www.ultraengine.com/learn/Entity_GetAirborne Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Sweetgebus Posted November 26, 2023 Author Share Posted November 26, 2023 3 hours ago, Josh said: You need this: https://www.ultraengine.com/learn/Entity_GetAirborne is this specific to ultraengine? or is the same for leadwerks 4.6? Quote Link to comment Share on other sites More sharing options...
reepblue Posted November 26, 2023 Share Posted November 26, 2023 Just now, Sweetgebus said: is this specific to ultraengine? or is the same for leadwerks 4.6? Should be the same. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Sweetgebus Posted November 26, 2023 Author Share Posted November 26, 2023 Just now, Sweetgebus said: is this specific to ultraengine? or is the same for leadwerks 4.6? function Script:UpdatePhysics() self.entity:AddForce(0,0,-.5) if window:KeyHit(Key.Space) then self.entity:AddForce(0,10,0,true) end end Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.