Problems with attaching sword to entity.

Posted By: PeterM

Problems with attaching sword to entity. - 07/09/07 13:34

Hey.

It's not what you think i searched the forum and i found the answer here:
http://www.coniserver.net/ubbthreads/sho...true#Post730752

Now I have attached the sword to the player, but when i move the player
sword lags a little behind. The faster player moves farther away is the sword.
I made a picture to explain better.

Link To Picture

On seckond and third picture player moves to the right and to the left.
And you can see how sword stays behind.

How can i fix that?

Tnx for your help.
Posted By: Fenriswolf

Re: Problems with attaching sword to entity. - 07/09/07 18:24

Hi,

the reason for this behaviour is the execution order of your functions.
If your 'attaching sword to entity' code is executed prior to your player's movement code, the sword is logically placed where the player was located one frame before.

Well, you could merge both scripts and call the attaching code right after the movement code to solve the problem.
Maybe putting the wait instruction of you attaching code right at the beginning of the while loop or using proc_late could work as well.
Posted By: PeterM

Re: Problems with attaching sword to entity. - 07/09/07 19:11

thank you Fenriswolf for the answer I putted the code after ent_move function and it works great now.
© 2024 lite-C Forums