Movement on MouseRightDragged
by Playware · in Torque Game Builder · 12/22/2006 (2:30 am) · 2 replies
Hi,
Here I need to do movement with right MouseDragged function. I am using
function sceneWindow2D::onRightMouseDragged( %this, %mod, %worldPos, %mouseClicks )
{
myObject.moveTo(%worldPos, 30);
}
No main Problem heppens here. For a few seconds, it runs quite good. But slowly-2 Game speed goes to very slow and jerky and after some times hanged.
What could the problem ?
How I will get smooth movement with onRightMouseDragged.
any help is appreciated.
thnx.
Here I need to do movement with right MouseDragged function. I am using
function sceneWindow2D::onRightMouseDragged( %this, %mod, %worldPos, %mouseClicks )
{
myObject.moveTo(%worldPos, 30);
}
No main Problem heppens here. For a few seconds, it runs quite good. But slowly-2 Game speed goes to very slow and jerky and after some times hanged.
What could the problem ?
How I will get smooth movement with onRightMouseDragged.
any help is appreciated.
thnx.
About the author
#2
No matter where the object is or where I clicked, attempt to MoveTo() the *dragged* location.
I don't see a use for this; but maybe I'm blind to your game/project idea.
If you post here a more detailed description of how you want things to happen, I'll write up the script to get you started, if you'd like.
12/24/2006 (1:37 am)
I would rethink your logic. With that function and that function alone, your object will only move when the right mouse is dragged. Not when it's clicked, and held still. Also it wouldnt matter if you clicked on the object or just a random spot on the screen. Pretty much what you're saying is:No matter where the object is or where I clicked, attempt to MoveTo() the *dragged* location.
I don't see a use for this; but maybe I'm blind to your game/project idea.
If you post here a more detailed description of how you want things to happen, I'll write up the script to get you started, if you'd like.
Torque Owner Anton Bursch