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

Ball Bounce like in mobile game "Phases"

Discussion in 'Physics' started by MiDuS, Sep 21, 2015.

  1. MiDuS

    MiDuS

    Joined:
    Sep 21, 2015
    Posts:
    5
    Hi

    Iam new to unity, can someone help me with making the ball bounce just like in this game "Phases" https://play.google.com/store/apps/details?id=com.ketchapp.phases.

    Youtube video making of phases in Buildbox


    This is what i have tried so far

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PlayerController : MonoBehaviour {
    5.  
    6.     private Rigidbody myRigidbody;
    7.  
    8.     public float speed;
    9.  
    10.     void Start(){
    11.  
    12.         myRigidbody = GetComponent<Rigidbody> ();
    13.     }
    14.  
    15.  
    16.     // Update is called once per frame
    17.     void FixedUpdate () {
    18.  
    19.         float moveX = Input.GetAxis("Horizontal");
    20.  
    21.         Vector3 movment = new Vector3(moveX, 0.0f, 0.0f);
    22.      
    23.     myRigidbody.AddForce(movment * speed);
    24.      
    25.  
    26.  
    27.     }
    28. }
    29.  
    Ball (Player)
    upload_2015-9-21_20-24-28.png


    Physic Material i have added to ball.
    upload_2015-9-21_20-22-41.png

    I want ball to bounce and move just like in the game phases. how can i do that in unity?

    Thank you.
     
  2. MiDuS

    MiDuS

    Joined:
    Sep 21, 2015
    Posts:
    5