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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Make a virtual sphere jump

Discussion in 'General Graphics' started by Joana15, Sep 8, 2015.

?

Make a virtual sphere jump augmented reality

  1. Vuforia

    0 vote(s)
    0.0%
  2. Unity

    0 vote(s)
    0.0%
  3. Augmented Reality

    0 vote(s)
    0.0%
  4. C#

    1 vote(s)
    100.0%
  1. Joana15

    Joana15

    Joined:
    Nov 18, 2013
    Posts:
    4
    I'm trying to make a sphere jump over a target, but the sphere goes forward camera when I press space (doesn't up), and the sphere doesn't goes down. I'm using vuforia 5 extension and unity 5

    my code

    using UnityEngine;
    using System.Collections;

    public class Jump : MonoBehaviour {
    public Rigidbody sphera;
    public float jump;

    // Use this for initialization
    void Start () {
    sphera = GetComponent<Rigidbody>();
    }

    void Update () {
    Vector3 movement = new Vector3(0, jump, 0);
    if (Input.GetKeyDown (KeyCode.Space )){
    sphera.AddForce(movement);
    }
    }
    }
     
  2. LaJean

    LaJean

    Joined:
    Sep 6, 2015
    Posts:
    10
    How high to jump? ;)
     
  3. Joana15

    Joana15

    Joined:
    Nov 18, 2013
    Posts:
    4
    Anything that fits on a mobile screen...