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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

throw ball along path

Discussion in 'Physics' started by triboolpraktikum, May 14, 2018.

  1. triboolpraktikum

    triboolpraktikum

    Joined:
    Apr 3, 2018
    Posts:
    4
    Hello, i want to throw a ball, but before i want to see the path
    i use simple physics math like : sy(t) = vy * t + g * t * t ;
    sx = vx * t;

    then i use rigidbody.velocity = tranform.forward * velocity;

    in the calculation i use the same velocity of corse.(the same vector3)
    g is 9.81 of corse

    my parabola looks pretty fine but doesnt match the path the ball goes in game.
    Is there anything i should know about physics and units? (I am little noob....)

    any ideas?
     
  2. triboolpraktikum

    triboolpraktikum

    Joined:
    Apr 3, 2018
    Posts:
    4
    g = - 9.81 **
     
  3. Hyblademin

    Hyblademin

    Joined:
    Oct 14, 2013
    Posts:
    725
    Did you set linear drag to 0 in the Rigidbody properties? Drag makes this formula inaccurate.
     
  4. triboolpraktikum

    triboolpraktikum

    Joined:
    Apr 3, 2018
    Posts:
    4
    Hello thanks for reply,

    i testeted to change drag and angular drag to 0f didnt change anything ;D

    since i use a random velocityMultiplier of 1.4f the curve matches fine in my range of usage,
    i think my formular is right somehow, but the velocity seems to be different.

    if i use multiplier of 1f, the ball always fly byond the highpoint( to strong)