whydoidoit / position

Retrieves the world position of a vector or Entity in PlayCanvas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Retrieves the world position of a vector or Entity in PlayCanvas


Languages

Language:JavaScript 100.0%