Hi there, I have a simple code that moves box around using arrow keys
...
// update code called every frame
Moving.prototype.update = function(dt) {
pos = this.entity.getPosition();
if (this.app.keyboard.isPressed(pc.KEY_UP)) {
this.entity.setPosition(pos.x, pos.y, pos.z - 0.01);
...
Now my plan is to move the box according to the camera position (X/Z) instead of world
In other words, move the box towards the camera (Pressing KEY DOWN), away from the camera (KEY UP), no matter which way you look at the box, the movement must remain the same
What functions to use to calculate this movement/directions?