unity3d - How to check where rigid body will land before throwing it? -
i want have cannon , player adjusts force applied fire it, i'd show cannonball land.
looks formula want here: http://en.wikipedia.org/wiki/trajectory#uniform_gravity.2c_no_drag_or_wind i'd know if unity can provide me without coding formula (as it's used in unity), 1 reason being don't want make mistake calculation won't correspond unity when cannonball fired.
unfortunately, unity's physics isn't deterministic. i've seen few teams trying implement this. takes lot of time, , usually, 1 of following approaches taken in end:
- using own custom-written deterministic physics — it's time-consuming , requires lot of changes whole project
- approximating unity's physics special code — it's not precise , can differ end result
- speeding unity physics, launch invisible clone of object same parameters , display trajectory has taken — still takes time compute. ask game designers if they're ok trajectory appearing "animation" starts each time after player moves cannon — "animation", of course, actual movement of invisible cannonball clone.
Comments
Post a Comment