top of page

VR Button

This is a physic base button class. Can be used in the game world or as a child actor component.

Class name:



Lines of code:


#include "VR/VR_Actors/VR_Button.h"

Interactable Actor


​General Information


VR Button is a class which is fundamental for all buttons. The class uses Physics Constraint Component to achieve physics interactions.



  • Parent Actor - This is a Static Mesh variable to which button will be connected by using Physics Constraint Component(Body_PhysicsConstraint).

  • Fall In Distance - This is a float value which indicates how deep the button can go.

  • Return Force - This is a float value which indicates return to initial position force.

  • Velocity Strength - This is a float value which indicates velocity strength.

  • Max Force - This is a float value which indicates maximum return force value.

  • Do Once Press - This is a bool value which indicates if button can be pressed only once.

  • Slide Direction - This is a vector value which indicates in what direction button can be pushed(-1 means inverted direction).


Do On Pressed - This is an event which can be defined and playes each time(or once if Do Once Press variable is set to true) button is pressed.

Blueprint API Reference

Public Member Functions


Set Parent

  AStaticMeshActor* ParentActor

Set Parent Component

  UPrimitiveComponent* PrimitiveParentComponent

Is Pressed


Update Return Force

 float Force
 float Velocity
 float Max_Force

Public Attributes


float 	FallInDistance

float 	ReturnForce

float 	VelocityStrength

float 	MaxForce

FVector 	SlideDirection

Protected Attributes


class USceneComponent * 	RootScene

class UStaticMeshComponent * 	Body_Mesh

class UPhysicsConstraintComponent * 	Body_PhysicsConstraint

class AStaticMeshActor * 	Parent_Actor

FVector 	PrevLoc

bottom of page