Search Unity

  1. Full schedule for #UniteBerlin is now available! Featuring talks on our roadmap, hands-on labs and much more! Check it out!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. 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:
    697
    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)