LogoLogo
VIVERSESupportBlogDiscord
  • Creator Tools
  • Polygon Streaming
  • Introduction to Creator Tools
  • Publishing with Your VIVERSE Account
  • Optimization
  • World Decoration
    • Edit Mode
    • Supported Media & Settings
    • Creating From Templates
      • Pet Rescue Template Project
  • PlayCanvas SDK
    • PlayCanvas Extension Setup
    • Publishing to VIVERSE
    • Scene Settings
    • No Code Tools
      • Sample Project
      • Quests
      • Trigger & Action
        • Event Listeners
        • Entity Enabling & Disabling
        • Entity Collision Enabling & Disabling
        • Entity Physics
        • Avatar Teleport & Checkpoint
        • Animation & Sound
        • Asset Management
      • Media
        • Polygon Streaming
        • Images
        • Video
        • Audio
      • Pick and Throw
      • Networked
      • Seat
      • GPU Mesh Instancing
    • Custom Code
      • Connecting No-Code Events to Custom Scripts
      • Introduction to MJS
      • Camera Management: Settings and Switching
    • Examples
      • Create Your First PlayCanvas Project
      • SHADEART | Custom Shader
      • WITHIN | A Generative Audiovisual Maze
      • First Person Shooter with Destruction
  • Unity SDK
    • Porting from Unity to PlayCanvas
Powered by GitBook
LogoLogo

Important Links

  • COOKIE POLICY
  • TERMS OF SERVICE
  • PRIVACY POLICY
  • VIVERSE PARTNERS

Socials

  • X / Twitter
  • LinkedIn
  • Instagram

© 2025 HTC CORPORATION

On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. PlayCanvas SDK
  2. No Code Tools
  3. Trigger & Action

Entity Physics

This document provides a guide that can be used to add a physics force to objects in VIVERSE project. The action can be configured to execute when a trigger is activated.

PreviousEntity Collision Enabling & DisablingNextAvatar Teleport & Checkpoint

Last updated 3 months ago

Was this helpful?


EntityRigidbodyAddForceInPhysics

Create An Action That Adds Force To An Object

This guide provides instructions for setting up the EntityRigidbodyAddForceInPhysics action. In the sample app, once the avatar enters the blue trigger area, a force is applied to the sphere.

The sphere is not moving before the avatar enters the trigger area.

Once the avatar enters the trigger area, a force is applied to the sphere in the direction based on the parameters.

In this example, a trigger is created and when the avatar or other objects enters the trigger area, an action adds force to an object. Any object can be used as a trigger, as long as the object has a collision component. This example uses a 3D box as the trigger area.

1

Create a trigger area

A. Create a new 3D Box entity.

B. This Collision component is not required for the EntityRigidbodyAddForceInPhysics action to work. The Collision component is required for the EntitySubscribeTriggerEnter trigger that will be used in this example.

C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.

D. Click the Edit Viverse Extension button.

2

Add the EntitySubscribeTriggerEnter trigger

A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.

B. Add a Trigger and select EntitySubscribeTriggerEnter.

C. Add local-player to the tags to filter field.

D. Add an Action and select NotificationCenterPublish.

E. Create a unique name for the notification and add it to the notification name to publish field. In this example, the AddForce name is added.

3

Create the 3D object that the physics force will be applied to

A. Create a new 3D object.

B. Add a Collision component.

C. Add a Rigidbody component.

D. Set the Collision Type to Dynamic.

E. Click the Edit Viverse Extension button.

4

Add the EntityRigidbodyAddForceInPhysics action

A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.

B. Add a Trigger and select NotificationCenterSubscribe.

C. The same text that was added to the notification name to publish needs to be added to the notification name to subscribe.

D. Add an Action and select EntityRigidbodyAddForceInPhysics.

E. In the X Force, Y Force and Z Force fields, add values for the amount of force to apply in each direction.