# Calculate force applied to rigidbody to make it land at specific location

 0 Hi I am trying to create some sort rts game, where some of the units throw stones. What I want to achieve is when the unit sees an enemy unit, it will throw a rock at it (I will calculate the precision later). So I know the distance from the throwing object to the receiving object. I can decide a specific angle it should be thrown at always. Does anyone know where to look if I want to figure out what force should be applied to the object, to make it hit its destination? more ▼ asked Nov 25 '11 at 09:43 PM Tabu 176 ● 23 ● 26 ● 38 That would require complex use of mathematics. The first example on this page shows off what I think you are asking. http://itween.pixelplacement.com/examples.php Nov 25 '11 at 09:50 PM OrangeLightning add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users

 0 you could put and empty gameobject at the target and then put Transform.LookAt(target); on the rock and then just make the rock move forwards and it will go at the target more ▼ answered Nov 26 '11 at 07:21 AM sam32x 178 ● 38 ● 55 ● 62 Thanks, it seems like a usefull idea for a simple sollution.. however, I need a nice curve, this sollution will likely slam into the ground before, or make a strange curve if initial force it applied to the rock. It will reach its target no doubt, but I think this is not the entire sollution.. unless I have misunderstood what your saying completly? Nov 26 '11 at 07:39 AM Tabu add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users

By Email:

Topics:

x1869
x308
x54

asked: Nov 25 '11 at 09:43 PM

Seen: 1552 times

Last Updated: Nov 26 '11 at 01:22 PM