how to move object like this?
#1

Let's say I want to throw an object, like ball for example. But I need to move the object like this;



I think it requires some math tricks. I suck in math, so..
Anyway, does anyone know how to do that?
Reply
#2

MoveObject works in a straight line, so you'd have to do something like this:



Or you could rapidly SetObjectPos along the line.
Reply
#3

There must be another way. I mean, like when player throws a grenade, the grenade smoothly moves in the air and hit the ground. If that was possible in gtasa, why not in sa-mp?
Also, I've seen in some sa-mp cod server where there was a grenade launcher(on m4). It smoothly launches a grenade like the real grenade launcher.
Reply
#4

Have a look in physics made by PeppeAC. There are 2D and 3D physics, might help you.
Reply
#5

This is a fs that I did to make you understand how physics work.. might help you better understand how it works instead of looking in the big code recommended by Riddick94

http://pastebin.com/gUbRxbY4

basically you have to joke with this configs

pawn Код:
OBJ[ID][vx] = floatsin(-ang, degrees) * -5.5;
OBJ[ID][vy] = floatcos(-ang, degrees) * -5.5;
OBJ[ID][vz] = -3.5;
OBJ[ID][gravity] = 10.1;
OBJ[ID][bounce_factor] = 40.49;
OBJ[ID][radiuss] = 0.2;
OBJ[ID][friction] =  0.001;
You can find them in the test command

If you don't want mapandreas just set the z cord as you wish and the object will bounce when the object pos is < than z cord
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)