Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Help with gravity script (Newb)

Discussion in 'Scripting' started by Cazforshort, Feb 25, 2016.

  1. Cazforshort

    Cazforshort

    Joined:
    Feb 22, 2016
    Posts:
    16
    Hello, I was wondering if someone could help me put together a script for this.



    So the game object(sphere) is hovering at first like zero G, then when it comes into contact with something gravity is back on and the momentum is conserved. Think in the lines of a floating baseball that gets hit by a bat. If hit hits the ground in a certain region it goes back to start.

    Thanks in advance
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,741
    Image link is broken, try again?
     
  3. Cazforshort

    Cazforshort

    Joined:
    Feb 22, 2016
    Posts:
    16
    I actually got it working, but I tried to create a prefab out of my camera and everything broke. Have you seen this error?