Jump to content

[SOLVED] Switching camera


photo

Recommended Posts

Posted

Hi, I just beginner in Unigine engine can you explain to me how to switch camera. For example i can get any node from Editor

Unigine::World::getNodeByName("Some_NodeName");

If i right understand, i need change camera in current player like this:

Game::getPlayer()->setCamera(SomeNewCamera)

I can create new camera and setup any settings for it but there is question: Can i get camera like "node" from editor?

Posted

Hello,

Yes, that should work, but you only have to switch the players:

	NodePtr player_node = World::getNodeByName("new_player");
	PlayerPtr new_player = checked_ptr_cast<Player>(player_node);
	Game::setPlayer(new_player);

Thanks!

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

Posted

Thanks for your time, it works!!

  • morbid changed the title to [SOLVED] Switching camera
×
×
  • Create New...