I am trying to make a planet that the player can walk around.
The problem is that the camera can only rotate on 2 axis so if I try to work on the south pole everything is upside down. Rotating the entire planet could crash the engine and switching to game camera each time I do something is gonna take forever.
Anybody knows how to edit engine scripts?
More camera controls in editor
I made a 6DOF camera control plug-in for the Godot editor called Godot Space Mouse.
https://github.com/cybereality/godot-space-mouse
If you want to use it, you need a Space Mouse or Space Navigator, they start at around $150.
You can also look at my source code and try to do the same thing with another controller you have, such as an Xbox controller. I am considering adding Xbox controller support, but this may take a few days and I'm not sure if people would use it. But in theory it is possible.
cybereality I am considering adding Xbox controller support, but this may take a few days and I'm not sure if people would use it. But in theory it is possible.
Maybe support for all standard flightsticks/analog inputs?
- Edited
I am not yet too deep into that, at least concerning the Godot part.
Question: What exactly means "planet" ? A real world celestial body or just a sphere with a limited diameter, like No Man's Sky or Kerbal Space Program ?
Getting the correct camera orientation is simple: usually, one would make the planet centre the origin of the coordinate system. One needs to control the camera up-vector so that it points away from the centre. On a sphere set at the centre of the coordinate system this is simply the negative of the normalized position. This is a rotation that can be done in a script, maybe you have to add a node that the camera is attached to (spatial?) to accomplish that.
Once that's done, new challenges are waiting: Movement on a sphere needs transformation between coordinate systems. And in case of precision problems solutions like relative-to-eye are needed. Not sure if you can replicate that in Godot (yet) with reasonable peformance.
But real world planets are not that simple, they aren't spheres and they are really big.
Megalomaniak Maybe support for all standard flightsticks/analog inputs?
Someone on YouTube was asking about HOTAS support, which does have enough axes. I'm not sure it's a huge market, but it is much bigger than the people that own Space Mouse devices. But I was thinking Xbox controller would make more sense, since almost everyone has one. Though I guess I could just add some analog input mappings and people can use whatever they want. I'd have to think about this.
Can you make a simple addon that allows me to rotate camera with 2 keyboard buttons? (one axis, increase decrease value)
- Edited
I may have a workaround:
- Add a spatial as camera pivot
- attach the camera under the pivot, with an offset but looking at the pivot
- split the editor in 2 viewport, one is your editor, the other the camera
- place the pivot where you're working, and rotate the camera as you like
This way you can at least control your work directly.
axelz58 Can you make a simple addon that allows me to rotate camera with 2 keyboard buttons? (one axis, increase decrease value)
Yes, it's possible. I have some stuff to finish with school right now, but if you can wait a few days I should be able to mock something up.
I can wait.