decentraland-scenes / grab-objects-advanced

Demonstrates how you can grab and move an object with physics.

Home Page:https://grab-objects-advanced.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grab Objects Advanced

demo of grab-objects-advanced scene running in preview.

demo

Description

Demonstrates how you can grab and move an object using the cannon.js physics engine. This is the advanced version of this scene here. To view the scene, please visit here.

Instructions

  • Use your mouse to look around and W A S D keys on your keyboard to move forward, left, backward and right respectively.
  • To jump, press the Space key.
  • To grab the object, click and hold the Left Mouse Button.
  • Press and hold the E key to pull the object in.

Issues

There are a couple of issues that need looking at:

  • Object reorientates itself when you first pick it up.
  • Making large arcs/turns whilst holding the object can cause the object to go out of bounds.

Try it out

Install the CLI

Download and install the Decentraland CLI by running the following command:

$ npm i -g decentraland

Previewing the scene

Download this example and navigate to its directory, then run:

$  dcl start

Acknowledgements

Code is adapted from https://github.com/schteppe/cannon.js/blob/master/examples/threejs_mousepick.html

About

Demonstrates how you can grab and move an object with physics.

https://grab-objects-advanced.vercel.app/


Languages

Language:TypeScript 93.9%Language:Dockerfile 6.1%