Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    703
    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)