Player movement. Author Message
Dampire
Member

 Post: #1 Player movement. How to move up player with constant speed. It's need for wallrun. Code, if it possible.
12-16-2009 04:23 PM
Brainache
Member

 Post: #2 RE: Player movement. Vec dir = direction you want to move in... player.actionMoveDir(dir); that ought to move the player in a specific dir based on the players speed
12-17-2009 12:34 AM
Dampire
Member

 Post: #3 RE: Player movement. Thnx. Hmm... actionMoveDir(ctrl.actor.matrix().y); - player moves to the right actionMoveDir(ctrl.actor.matrix().z); - player moves forward actionMoveDir(ctrl.actor.matrix().x); - player moves to the right Is this normal? (This post was last modified: 12-17-2009 07:50 AM by Dampire.)
12-17-2009 07:42 AM
Brainache
Member

 Post: #4 RE: Player movement. It would be more like: Vec dest = some x,y,z coord Vec pos = chr.pos(); Vec dir = dest - pos; dir.normalize(); chr.actionMoveDir(dir); Not sure what the value of your ctrl matrix is... If it was unrotated and normalized... I would expect .y = Vec(0,1,0) .z = Vec(0,0,1), and .x = Vec(1,0,0)... Which would make .z = move forward, .x = move left, .y = no move since phys wouldnt let him move up... At least - Thats my thinking - havent tested any of those...
12-17-2009 02:23 PM
Esenthel
 Post: #6 RE: Player movement. Code: ```ctrl.actor.gravity(false); actionMoveDir(Vec(0,1,0));``` move up, but set direction to the right... if only Code: `actionMoveDir(Vec(0,1,0));` set direction to the right and move to the right. Hm... Ok, I will work with standart addImpulse(). Thanks. (This post was last modified: 12-17-2009 04:35 PM by Dampire.)