Player
List of chapters
The “Player” object is an object that represents the user in the scene. The player appears at the location of the “Default Player Appearance Point” object. This object can be moved on all three axes, and rotated on the Y axis, but cannot be scaled or rotated on the Z and X axes
A more detailed description of the object can be found in the article player spawn point
Player moving
- Teleportation allowed/forbidden - the block that allows or forbids the player to use teleportation through the scene
- Move with WASD keys in Desktop mode = allowed/forbidden - the block that allows to set the limitation of the player on the scene with the WASD keys in Desktop mode
- Return to the starting position - action that returns the player to the point of appearance
- Teleport to object N - calling this block will teleport the player to the specified object
- Teleport to X, Y, Z - calling this block teleports the player to the specified coordinates
- Move to object N with speed M - the block moves the player to the specified object with the specified speed
- Move to N coordinates at speed M m/s - the block that moves the player to the coordinates that the player can specify with the coordinates block in the math, or to a specified object. In addition to the destination, in the block you must specify the speed of the player’s movement
Player Rotation
- Instant horizontal rotation - a block, the execution of which instantly turns the player in the horizontal plane (along the Y axis) in accordance with the specified rotation degree
- Set pivot in coordinates - a block, which rotates the player along the corresponding axes, specified in the block
- Instantaneous rotate to/from object - a block that allows the player to instantly rotate towards an object, or in its direction
Interaction with objects
- Set interaction with objects = allowed/forbidden - the main function in this category that allows you to set permission or prohibition for the player to interact with all objects in the scene
- Hand Collision - an event that reacts in VR mode to the collision of the player’s hand
- The player is holding in the “right/left” hand “Object” - a logical block that transmits a true or false value, depending on whether the selected object is in the left or right hand of the user at the moment
Force take / release object - the ability to forcefully attach and detach an object from the player. To do this, in the scene editor place the object with which the user wants to interact. More information about the placement of objects on the stage
Let’s look at these logical actions one by one:
- The first function allows you to attach an object to the player. To do this, the first field specifies directly the player. In the second field, the user can select an object from a list already on the stage. And the third field, the field indicating to which hand, right or left, the object should be attached
- The second function is similar, except for the field with the object that must be released from the hand
Control boxes for wand beam appearance in VR
The Controller Pointer Beam is a beam emanating from the controller that the user sees in VR mode, helping the user better “aim “ at objects in the scene in the running project. The beam can be customized based on your needs, viz:
Setting the length of the wand’s beam, a parameter that affects both the visual part of the beam and the functional part. So, if the user sets the length parameter to 0, he won’t be able to interact with objects because there will be no beam
If the block is not used in the logic of the project, the default beam length is 1.5 meters
The width of the wand’s beam is a beam parameter that adjusts, depending on the option chosen, either the start width or the end width. To set the start and end beam widths at the same time, bring up two blocks, with the start width in the first block and the end width in the second block. The parameter is specified in meters
Hide beam when teleportation is disabled - the parameter that hides the teleportation beam if the rule prohibiting the player to teleport is set
The wand beam color is a parameter that sets either the starting color of the beam or the ending color. To set the color, click on the color in the block and specify the color either in HEXA/RGBA/HSLA formats or in a palette. More about working with color
Obtaining the position and rotation of the player’s view angle
These two functions return the position and rotation positions of the player’s head, respectively, as vector data in world coordinates
Other player settings
- Vibrate with settings for left/right hand with force N, duration M, interval L - parameter that works only in VR mode, setting vibration with the parameters specified in the block
- Vibrate for left/right hand with intensity slightly/strongly - setting the vibration intensity for right or left hand
- Cursor display in desktop mode = Enabled/Disabled - displays the cursor (point) on the screen
- Rotate camera with mouse in desktop mode = enabled/disabled - allows or forbids the player to rotate the camera in the desktop player mode
- Player subordinate/not subordinate to gravity - the parameter that sets the possibility for the player to use the physical properties of gravity, for example, to jump (default
Space
) or fall, if the player has no floor from the floor of his feet. If gravity is disabled, the rules will not apply