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 ghostreddy · Jul 18, 2012 at 02:22 PM · dynamics

whats dynamics of the playerball based on differential equations

Hey...

What do they mean by below :

The dynamics of the players based on differential equations of my original work has been implemented in the video game ?

Thanks!!!!

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
0

Answer by Julien-Lynge · Jul 18, 2012 at 03:48 PM

Differential equations are equations where the change in value of the equation at any time relies on the value of the equation at that time. For instance, for a ball moving through air, the change in speed (due to drag) is dependent on the current speed of the ball - the faster it's going, the more drag there will be. These equations are continuous (what happens next relies on what was happening an instant ago), and so are notoriously tricky to try and solve using discrete methods, e.g. by updating the speed only 60 times per second. Unfortunately, that's the way video game engines work - they aren't built to solve continuous math problems.

If you want to know more about differential equations, you can check out Wikipedia or any sufficiently advanced math textbook. Be warned that if you haven't had multiple semesters of foundational math like calculus you probably won't get very far.

Comment
Add comment · Show 4 · 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
avatar image ghostreddy · Jul 18, 2012 at 04:12 PM 0
Share

@Julien : thanks for the reply.......below is the code that i am using for my enemy ball....how can implement the differential equations in the below code.

pragma strict

var Speed= 10; var wayPoint : Vector3;

function Start(){ //initialise the target way point Wander(); }

function Update() { // this is called every frame // do move code here transform.position += transform.TransformDirection(Vector3.forward)*Speed*Time.deltaTime; if((transform.position - wayPoint).magnitude < 3) { // when the distance between us and the target is less than 3 // create a new way point target Wander();

     // don't need this 

     //transform.LookAt(wayPoint);
     //transform.position += transform.TransformDirection(Vector3.forward)*Speed*Time.deltaTime;
 }

}

function Wander() { // does nothing except pick a new destination to go to wayPoint= Random.insideUnitSphere *12; wayPoint.y = 0.7; // don't need to change direction every frame seeing as you walk in a straight line only transform.LookAt(wayPoint); //Debug.Log(wayPoint + " and " + (transform.position - wayPoint).magnitude); }

Thanks!!!!

avatar image ghostreddy · Jul 18, 2012 at 04:14 PM 0
Share

Code that I'm using :

pragma strict

var Speed= 10; var wayPoint : Vector3;

function Start(){ //initialise the target way point Wander(); }

function Update() { // this is called every frame // do move code here transform.position += transform.TransformDirection(Vector3.forward)*Speed*Time.deltaTime; if((transform.position - wayPoint).magnitude < 3) { // when the distance between us and the target is less than 3 // create a new way point target Wander();

     // don't need this 

     //transform.LookAt(wayPoint);
     //transform.position += transform.TransformDirection(Vector3.forward)*Speed*Time.deltaTime;
 }

}

function Wander() { // does nothing except pick a new destination to go to wayPoint= Random.insideUnitSphere *12; wayPoint.y = 0.7; // don't need to change direction every frame seeing as you walk in a straight line only transform.LookAt(wayPoint); //Debug.Log(wayPoint + " and " + (transform.position - wayPoint).magnitude); }

avatar image Julien-Lynge · Jul 18, 2012 at 04:19 PM 0
Share

@ghostreddy

Two issues: first, you need to format your code. $$anonymous$$ake sure that every line of code has 4 spaced in front of it, then UnityAnswers will nicely format it.

Second, you haven't told me what the differential equation is that you want to integrate into your code.

avatar image ghostreddy · Jul 18, 2012 at 04:38 PM 0
Share

@Julien.Lynge :

formatted code:

pragma strict

  var Speed= 10;

  var wayPoint : Vector3;

   function Start(){


     //initialise the target way point

     Wander();
  }

  function Update() 
  {
     // this is called every frame
          // do move code here
     transform.position +=       transform.TransformDirection(Vector3.forward)*Speed*Time.deltaTime;
      if((transform.position - wayPoint).magnitude < 3)
      {
          // when the distance between us and the target is less than 3
          // create a new way point target
           Wander();

          // don't need this 

          //transform.LookAt(wayPoint);
          //transform.position +=            transform.TransformDirection(Vector3.forward)*Speed*Time.deltaTime;
      }
  }

  function Wander()
  { 
     // does nothing except pick a new destination to go to
      wayPoint= Random.insideUnitSphere *12;
      wayPoint.y = 0.7;
     // don't need to change direction every frame seeing as you walk in a straight line only
      transform.LookAt(wayPoint);
      //Debug.Log(wayPoint + " and " + (transform.position - wayPoint).magnitude);
  }



Second Point: the concept is to move the ball with certain speed around a circle & when it hits the player should one of the 3 lives.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Reduce draw calls with static / dynamic batching 1 Answer

Rigidbody velocity has got different direction than VelocityChange force vector 1 Answer

Car dynamics? 0 Answers

GameObjects missing on Flash Export 0 Answers

dynamic font is all black at galaxy s6 edge 0 Answers


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