Player

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

Note

A more detailed description of the object can be found in the article player spawnpoint

Player moving

../../_images/image-166.png
  1. Teleportation allowed/forbidden - the block that allows or forbids the player to use teleportation through the scene
  2. 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
  3. Return to the starting position - action that returns the player to the point of appearance
  4. Teleport to object N - calling this block will teleport the player to the specified object
  5. Teleport to X, Y, Z - calling this block teleports the player to the specified coordinates
  6. Move to object N with speed M - the block moves the player to the specified object with the specified speed
  7. 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

../../_images/image-238.png
  1. 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
  2. Set pivot in coordinates - a block, which rotates the player along the corresponding axes, specified in the block
  3. Instantaneous rotate to/from object - a block that allows the player to instantly rotate towards an object, or in its direction

Interaction with objects

../../_images/image-332.png
  1. 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
  2. Hand Collision - an event that reacts in VR mode to the collision of the player’s hand
  3. 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
../../_images/image-424.png
  • 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:

    1. 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
    2. 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

../../_images/image-518.png

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:

  1. 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

    Note

    If the block is not used in the logic of the project, the default beam length is 1.5 meters

  2. 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

  3. Hide beam when teleportation is disabled - the parameter that hides the teleportation beam if the rule prohibiting the player to teleport is set

  4. 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

../../_images/image-619.png

These two functions return the position and rotation positions of the player’s head, respectively, as vector data in world coordinates

Other player settings

../../_images/image-716.png
  1. 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
  2. Vibrate for left/right hand with intensity slightly/strongly - setting the vibration intensity for right or left hand
  3. 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