- Home /
How to Create a Launch Path?
Hello World
My problem is that I am a novice student, and I do not know how to create C # in the unit is a way to create a path to throw an egg that is at one end of a wooden board that is on top of a stone. the other stone falls on the other end, the egg must be thrown in a specific way. One of my ideas was to use Rigidbody, but I do not know how to control the trajectories of this force.
Attempt to graphically represent my problem
Answer by kevojo · Sep 19, 2018 at 05:20 AM
Conceptually speaking (I haven't done this myself) you could calculate a certain amount of points along the path if you know the velocity and the gravity. The velocity will propel it in a certain direction with diminishing effect, gravity will bring it down, if it's launch angle is above horizontal, you must calculate kinetic energy (the more vertical, the more kinetic energy, perfectly horizontal has no kinetic energy, perfectly vertical facing up has maximum kinetic energy, perfectly horizontal facing down has maximum negative kinetic energy) - the kinetic energy is also diminishing at a rate you can set. Based on that, you could calculate a point for every unit of measurement or time you decide (depending on how accurate you want to be) using an f(x) substitution function. You could store each point in your simulation in an array, and draw a line renderer from each point to the next point in the array.
Answer by Zodiarc · Sep 19, 2018 at 07:18 AM
Maybe calculating it like a Bullet Trajectory will do the trick.