Hi guys i’m working on a game in which it will be possible to take a spaceship to go between differents planets.
I already have a Sun with some planets turning around with a simple script :
#pragma strict
var rotation : Quaternion;
var radius = Vector3(5,0,0);
var degrees:float = 10;
var moonCurrentRotation = 0.0;
var planete : GameObject;
function Update(){
moonCurrentRotation += degrees*Time.deltaTime;
rotation.eulerAngles = Vector3(0, moonCurrentRotation, 0);
transform.rotation.eulerAngles = Vector3(0, moonCurrentRotation*30, 0);
transform.position = rotation * radius + planete.transform.position;
}
I have an other script which implement circular gravity so i can walk on the planet, take of, make an orbit and go to the moon (on foot ^^). So my problem is to draw the trajectory line of my ship where we can find the apoapsis and periapsis. In fact i would like to make something similar as you can see in Kerbal Space Program. I’m a beginner and i don’t know what to do at first. I know a little bit mechanics but i don’t know how i can use it for tracing a trajectory.
Thanks in advance for answers and excuse me for my english i’m french ^^.
KSP uses [Vectrosity][1]. [1]: http://www.starscenesoftware.com/vectrosity.html
– Eric5h5Thanks for the answer ! Is there free solutions to make something similar without using vectrosity ? The most important for me is to make the possibility for the player to make manual space flying at his own risks, and an automatic secure fast flying mode. The trajectories would be implemented in the player's radar and would be used just for the free mode. Automatic mode would be used for fastest travels ; i don't want to make a "wrap time" mode like KSP. I just want to make an adventure game and not a simulation.
– CocossPlease don't post a comment/follow up/thank you as ANOTHER answer as you did here, I changed this one for you.
– getyour411