Posts: 534
Threads: 265
Joined: Jul 2014
Hi,
I move dynamic object and when i get him pos GetDynamicObjectPos (when he is moving) i get position when he start a move. Why it'is? with createobject, even if i moveobject i always get position of moving object.
Posts: 376
Threads: 28
Joined: Jun 2012
Reputation:
0
Make sure that you're using CreateDynamicObject if you're using GetDynamicObjectPos. You said that you're using a dynamic object, but I can recreate this without issues.
Posts: 534
Threads: 265
Joined: Jul 2014
Yes am using everywhere dynamic object.
Posts: 534
Threads: 265
Joined: Jul 2014
Am doing that. I create dynamic object and then in OnPlayerUpdate i MoveDynamicObject to your position with 20.0 speed. And after that i want to GetDynamicObjectPos, but position is that from where object start to move and it have no change even dynamic object is targeting me.
Код:
OnPlayerUpdate (..)
{
MoveDynamicObject(...);
new Float:X,Float:Y,Float:Z;
GetDynamicObjectPos( ...X,Y,Z );
SetPlayerMapIcon( playerid, 69, X,Y,Z, 0, 0xFFFFFFAA, MAPICON_GLOBAL );
}
And i make an icon in minimap:
SetPlayerMapIcon( playerid, 69, X,Y,Z, 0, 0xFFFFFFAA, MAPICON_GLOBAL );
How i said icon in the same place where object start moved. With CreateObject, MoveObject and so on.. Then icon is changing place where is object.. I tried to Streamer_Update(playerid); when i MoveDynamicObject but this not help.
Posts: 33
Threads: 4
Joined: Jul 2013
Reputation:
0
You could save the object's position before moving it and add/subtract the difference between the new and the old position with the help of a timer.