Jump to content

Default Starting Location


photo

Recommended Posts

Without adding any players/cameras or things, I have a world that starts at 0,0 and has general movement with ASWD keys.  I would like to have whatever is getting spawned at 0,0 start at a different location, so they will be inside my structure/facility rather than just outside.  I know I could move my objects, but they come in relative to other things I've created in my Modeling software.  So I'd prefer to start the camera/player at a new spot.

I don't see anything in the general code so far.  I searched the documentation a bit, but probably was not searching for the correct thing.

Any guidance?

Link to comment
6 hours ago, fox said:

Hi Trey,

Have You tried using setWorldPosition() for your player giving coordinates of your desired spawn point? Players are inherited from the Node class.

This should do the trick!

Hope this helps!

Thank you!

Thanks, I'm sure that will help.  I'm a bit confused though.  What node do I even ask Unigine to set, as I don't have a Player in my scene.  But there is somehow a default player that has movement controls on it when I RUN the world.

I'm guessing it's using the SceneCamera as a player maybe?  Is there more you could elaborate on?  Thanks for the guidance.

Link to comment

Hi,

we have the Scene Camera (the one you control in Editor) and Game Camera that is used by default in your project. If you want to move this default camera just change coordinates in world script. See player.setPosition and player.setDirection values.

The more comfortable camera control could be achieved by placing a custom player instead of the default one. I suggest checking world script in "procedural buildings generation demo". It's simple and easy to re-use.

Fox meant that with setWorldPosition() you can easily change the coordinates of any node.

Thanks!

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

Link to comment
4 hours ago, morbid said:

Hi,

we have the Scene Camera (the one you control in Editor) and Game Camera that is used by default in your project. If you want to move this default camera just change coordinates in world script. See player.setPosition and player.setDirection values.

The more comfortable camera control could be achieved by placing a custom player instead of the default one. I suggest checking world script in "procedural buildings generation demo". It's simple and easy to re-use.

Fox meant that with setWorldPosition() you can easily change the coordinates of any node.

Thanks!

Thanks for the clarification @morbid  Sorry for the noob questions!

Link to comment
×
×
  • Create New...