Closed WilleD70 closed 3 years ago
Please, can you be more specific about "buildings"?
Hello! By building I mean building 3d models that stick to the planet. It would help if you could delete terrain, but keep atmosphere.
This is possible through raycast - in PlayerController class, you test for whatever button you want pressed. If that button is pressed, shoot a ray of defined length. If the ray hit an object of type CelestialBody, spawn a prefab "building" with the 3d model you want at a position of ray hit rotated according to the hit normal parented to the CelestialBody object. Additionally, you may check if the hit CelestialBody BodyType is not Sun before spawning prefab. Hope this helps.
This is possible through raycast - in PlayerController class, you test for whatever button you want pressed. If that button is pressed, shoot a ray of defined length. If the ray hit an object of type CelestialBody, spawn a prefab "building" with the 3d model you want at a position of ray hit rotated according to the hit normal parented to the CelestialBody object. Additionally, you may check if the hit CelestialBody BodyType is not Sun before spawning prefab. Hope this helps.
Hello! I've tried but I don't seem to get it right. If you wouldn't mind, could you make a video where you do it or something. All the best!
Hello again. I found a way to place gameobjects on the planets.
Please, can you be more specific about "buildings"?