Jump to content

[SOLVED] Updating camera position


photo

Recommended Posts

Hi,

 

I feel I'm missing something simple here, but when call setPosition on the camera it does not seem to do anything.

Player player = engine.game.getPlayer();
vec3 campos = player.getPosition();

if (toggle == 0) {
    campos.x += 10;
}else{
    campos.x -= 10;
}
player.setPosition(campos);

Link to comment

Hi Angus,

I'm afraid minimal working test scene is required. I've mode one scene which is working fine, please check the attachement (use x and z buttons to move player camera).

 

Also, if you are want to use setDIrection and setViewDirection in future, please check this topic first: https://developer.unigine.com/forum/topic/1617-solved-transform-and-position-bug/?hl=setPosition#entry8594

 

camera.zip

 

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Thanks. The issue was that I'd added two cameras to the scene (engine.editor and engine.game). I was updating one but looking through the other. Sorry for wasting your time.

 

[sOLVED]

Link to comment
×
×
  • Create New...