Mounted object animation lag?
by Rubes · in Torque Game Engine · 06/13/2007 (8:49 pm) · 6 replies
I have an NPC character in my game who needs to have a knife object (staticShape) mounted to his hand, at his mount0 point. I then play an animation (using setActionThread) that moves his arm around to make it look like he is cutting with the knife.
I use %npc.mountObject(%knife,0) to mount the knife to the NPC, and it mounts fine.
The problem is, when I play the animation, his arm and the knife move like they should, but the knife transform lags a bit behind his hand, making it look like the knife is slipping around within his hand. It even moves through his hand when it moves horizontally.
I've tried mounting the knife as an image using mountImage, and it works perfectly without any noticeable lag. But the problem is that I need to have the item mounted as an object, not an image, so this method will not work for me.
Is this lag mostly related to a slower update of the knife transform using the mountObject method, or is there something else I'm missing?
/Rubes
I use %npc.mountObject(%knife,0) to mount the knife to the NPC, and it mounts fine.
The problem is, when I play the animation, his arm and the knife move like they should, but the knife transform lags a bit behind his hand, making it look like the knife is slipping around within his hand. It even moves through his hand when it moves horizontally.
I've tried mounting the knife as an image using mountImage, and it works perfectly without any noticeable lag. But the problem is that I need to have the item mounted as an object, not an image, so this method will not work for me.
Is this lag mostly related to a slower update of the knife transform using the mountObject method, or is there something else I'm missing?
/Rubes
#2
06/18/2007 (6:43 pm)
Only a suggestion, if the horizontal slipping is happening when the NPC is trying to stab something it could be related to the mWeaponBackFraction setting on the NPC player.
#3
I'll see if I can put up a short video showing what I mean.
06/18/2007 (7:13 pm)
@Chris: Thanks, I think that only applies for mounted images, though, not objects. This is more of a "delay" in the movement of the mounted object as its mount point is animated...like the mounted object's movement lags slightly behind the movement of the point it's mounted to.I'll see if I can put up a short video showing what I mean.
#4
like maybe it's mounted to the wrist instead of palm or something ?
.. but it's probably a delay, as you describe.
what's the diff between a mounted image & a mounted object, btw ?
06/18/2007 (7:47 pm)
Rubes - guessing wildly here, but is it possible the mount node is not what you expect ?like maybe it's mounted to the wrist instead of palm or something ?
.. but it's probably a delay, as you describe.
what's the diff between a mounted image & a mounted object, btw ?
#5
I'm not too sharp with the specific code differences between mounted images and mounted objects, to be honest; I think images are lightweight versions of objects for better rendering and networking. The main difference for me is that mounted images do not have collision meshes, while mounted objects retain their collision meshes. This is important for me because I want to retain the ability to point-and-click on the mounted object to select it.
Another feature of mounted images is that they somehow become part of the object they are mounted to. So if I mount the knife as an image, when I click on the NPC to select him, the knife is also highlighted with him (as though the NPC and the knife were being rendered as one object).
Edited for clarity (I assume).
06/18/2007 (8:36 pm)
@Orion: I'm pretty sure the mount node is what I expect...it's just the mount0 node. If the NPC's arm stays still, the knife is mounted perfectly, as expected. It's when the arm becomes animated that the knife's position starts lagging behind the NPC's hand.I'm not too sharp with the specific code differences between mounted images and mounted objects, to be honest; I think images are lightweight versions of objects for better rendering and networking. The main difference for me is that mounted images do not have collision meshes, while mounted objects retain their collision meshes. This is important for me because I want to retain the ability to point-and-click on the mounted object to select it.
Another feature of mounted images is that they somehow become part of the object they are mounted to. So if I mount the knife as an image, when I click on the NPC to select him, the knife is also highlighted with him (as though the NPC and the knife were being rendered as one object).
Edited for clarity (I assume).
#6
06/03/2009 (6:24 am)
I want to ressurect this topic because I'm looking into mounting objects instead of images. It seems to me like the knife object is being rendered at the location of the hand node transform, not its render transform. I wonder how you'd go about rectifying that.
Torque 3D Owner Rubes