aNewLyfe 0 Posted December 11, 2010 Hi, after 2 days i've gave up. Problem is: i want to move a node forward by a keypress for example W. Well, moving on x+, x- or z+, z- is done. But i want to move node to forward. (Where it looking, facing at) variables i got: node rotation, node speed, node x,y,z points. Tried something like: $NODE_X += (cos(($PI/360)*($NODE_YROTATION+90))*$MOVE_SPEED) $NODE_Z += (cos(($PI/360)*($NODE_YROTATION+90))*$MOVE_SPEED) bad idea? my math is FF btw. Really waiting 4 your help. ~ Every Living Thing is a Code Snippet of World Application ~ Share this post Link to post Share on other sites
kaotkbliss 146 Posted December 11, 2010 (edited) you can create additional nodes (front, back left and right) that are too small to see. make them child nodes of the main node and when you movement key _ispressed() then set the main node position to the position of the front (back left or right) node $dll = DllOpen("user32.dll") If _IsPressed("57", $dll) Then;w $posf = _IrrGetNodeAbsolutePosition($FrontNode) _IrrSetNodePosition($node, $posf[0], $Pos[1], $posf[2]) ElseIf _IsPressed("53", $dll) Then;s $posb = _IrrGetNodeAbsolutePosition($BackNode) _IrrSetNodePosition($node, $posb[0], $Pos[1], $posb[2]) EndIf Edited December 11, 2010 by kaotkbliss 010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueekWe're gonna need another Timmy! Share this post Link to post Share on other sites
aNewLyfe 0 Posted December 12, 2010 you can create additional nodes (front, back left and right) that are too small to see. make them child nodes of the main node and when you movement key _ispressed() then set the main node position to the position of the front (back left or right) node $dll = DllOpen("user32.dll") If _IsPressed("57", $dll) Then;w $posf = _IrrGetNodeAbsolutePosition($FrontNode) _IrrSetNodePosition($node, $posf[0], $Pos[1], $posf[2]) ElseIf _IsPressed("53", $dll) Then;s $posb = _IrrGetNodeAbsolutePosition($BackNode) _IrrSetNodePosition($node, $posb[0], $Pos[1], $posb[2]) EndIf well tnx 4 reply and your time. But i've found the formula after 3 days ((Cos(direction degree * pi number / 180) * node movement speed)) ~ Every Living Thing is a Code Snippet of World Application ~ Share this post Link to post Share on other sites