1.0.0 • Published 7 years ago

playcanvas-get-position v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

Introduction

A function that returns the position of an entity if passed one, otherwise a Vec3 world coordinate in PlayCanvas.

Installation

npm install --save playcanvas-get-position

Usage

import getPosition from 'playcanvas-get-position'

...

MyPlayer.prototype.goto = function(entityOrPosition) {
    this.targetPoint.copy(getPosition(entityOrPosition));
} 
 

Requirements

Requires PlayCanvas Engine to be running on the page. Uses ES6/Babel/PlayCanvas template.