Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by letsfailsafe · Jun 03, 2013 at 10:28 AM · cameraphysicssimulationmoon

Basic questions for moon landing game

Hello,

I have decided to make a moon landing game for my school project. Our school is using C# for scripting.

I am really lost at this point since this is my first ever game I am developing. I also think I have decided to make too complicated game. (I have pretty good understanding of physics... (When it comes to thrust, I may have problems...))

This is all the scrip I have applied for now:

 using UnityEngine;
 using System.Collections;
 
 public class MoonPhysics : MonoBehaviour {
 
     void Start () {
     
     }
     
     void Update () {
     
         float thrust = Input.GetAxis("Vertical") * 10f;
         rigidbody.AddForce(transform.up * thrust);
         
         float rot = Input.GetAxis("Horizontal") * 10f;
         rigidbody.AddTorque(0,0,rot);
         
     }
 }


I have 5 questions.

  1. Have I chosen too difficult game? (I have about 5 weeks to develop this game)

  2. I have created terrain and I have no textures... what is going on? (Using free Unity version)

  3. How would I make the camera to track the TestShip (simple triangle acting as lunar module)

  4. Is physics for rocket thrust complicated to script and apply to a module? Or should I just stick to built in physics functions and use 'force'?

  5. I would like to be able to see altitude, speed and angular velocity etc.. how would I do that?

Thank you

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by robertbu · Jun 03, 2013 at 02:47 PM

I did a similar project with my daughter. What we did was pretty basic...a straight down landing with limited fuel and a velocity goal for a safe landing. Use too much fuel, and the module freefalls to it's death...too little and you hit too hard. We bypassed Unity's physics engine and used equations instead (for educational value). Day/hour one we developed a bounding ball using the equation. The actual lander project took an addition four days/hours to complete including the graphics time. But that is with me knowing the end goal, guiding, and helping her through the rough spots. She displayed altitude, fuel, velocity and acceleration.

The equation we used is:

alt text

Here is the key code she wrote based on that equation (executed in Update()):

 float fDeltaY = fVelocity * Time.deltaTime + fAccl * Time.deltaTime * Time.deltaTime / 2.0f;
 float fDeltaV = fAccl * Time.deltaTime;
 v3Point.y = v3Point.y + fDeltaY;
 fVelocity = fVelocity + fDeltaV;
 transform.position = v3Point;

Rather than have the camera track the module (third person), she used the camera as the module looking down. Here is a screen shot from the game view.

alt text

Some answers to your question:

1) How long this will take you to finish will depend on the scope you your game and if you have anyone to help you through any rough spots. An experienced programmer could do it in a few hours, but it is not uncommon to get technical questions on this list from folks who say they have been stuck for a week on a single issue.

3) The easiest way for a camera to track the module is to make the camera a child of the lander, but there are a couple of standard tracking scripts that come with Unity (Smooth Follow and Smooth Look At) as well as numerous posts on UA with other solutions.

4) I gave you the equation, so it's not too complicated. Using build-in physics is easier.

5) These indicators will fall out of whatever solution you use. If you get stuck, come back with a specific question.


moonlanding2.jpg (65.9 kB)
equation.png (618 B)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

simulating real world camera in unity 0 Answers

How to make first-person work in zero-G with planets? 1 Answer

Applying proper drag and center of mass for a vehicle 1 Answer

Is there a way to create water like behavior. 0 Answers

VR Camera jumps up and does not ignore collider even after turning off interaction between them in Layer Collision Matrix 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges