≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
behavior_doubleJump - Version 2
Posted by:
(you are not logged in)
Enter the missing letter in: "Intern?tional"
(you are not logged in)
Text:
[quote][b]xanimalkingx[/b] wrote: I improved my double jump plugin a bit before I decided to work on behavior_enhancedFPSCamera. These final changes have a few new things like the check of the camera's additive relative height (set from extension variable), a setting to decide if to do a collision action on scene/script startup, a new variable for allowing infinite jumps, and some extension variable name changes. [b]Description:[/b] [code] This is a CopperCube behavior which makes an object jump (with the ability to double jump) when space is pressed. Note that this behavior doesn't include movement scripts like moving with W, A, S, and D. Be sure to set jump speed to 0 for the scene node you're attaching this behavior to. The collision is checked by drawing a line from the scene node to an offset Y position below the scene node. The Y offset is the length of the line. The line extrudes to below the camera. Be sure not to input negative values as it will cause the line to extrude upwards instead, causing unwanted affects. The "HeightOfNode" and "AdditiveRelativeHieght" values can be found in the "Collide when moved" that you attached to the scene node that this behavior is attached to. This behavior only works with physics simulation enabled, which only the Windows and Mac targets support. To reset the values of all global variables in this behavior, call "behavior_doubleJump _resetValues();" within the "Execute JavaScript" action. This is useful if you want to reset the checking for when the very first collision has happened. [/code] [b]Behavior properties:[/b] [code] "SceneNodeName": The scene node that this behavior is attached to. "HeightOfNode": The length of the collision line. "AdditiveRelativeHieght": Additive to the length of the collision line. This should be "0" unless "RelativePosition" property in the "Collide when moved" behavior has a Y value greater than 0.0. "FirstJumpVelocity": The velocity (height) of the first jump. "SecondJumpVelocity": The velocity (height) of the second jump. "FirstJumpAction": The action that happens when the first jump happens. "SecondJumpAction": The action that happens when the second jump happens. "NoCollisionAcitonOnFirstCollision": Decides if the collision action should not happen when the very first collision happens. "CollisionAction": The action that happens when collision of the line and the ground happens. [/code] [b]CopperCube variables that this script checks for (be sure to set these at scene startup):[/b] [code] "DisableJump": if equals 1, disable jumping. Useful if you dont want to allow the player to jump during cutscenes and such. "DisableDoubleJump": if equals 1, disallow a second jump. Useful for double jump to be an unlockable or not to be allowed at all. "InfiniteJumps": if equals 1, allow infinite jumps. Useful for debugging your game. [/code] [b]Functions that this behavior has that can be executed by the "Execute Javascript" action:[/b] [code] "behavior_doubleJump_resetValues();": Reset the values of all the global variables within this behavior. Useful for reseting the check for the very first collision. [/code] [b]Download:[/b] [url]https://www.mediafire.com/file/j23dav6dni4dng9/behavior_doubleJump.js/file[/url] Niko, you haven't put my behavior on the behaviors page yet despite asking if you could put that there. Since you asked, Ill say yes, again. Put this one there instead, as well.[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact