Gryphon_de Posted July 18, 2011 Share Posted July 18, 2011 Hello! How can I tune character controls to enable "Fly mode"? I want my char to free fly in this mode: for example, forward move direction is exact camera direction, not just XOY projection of it. I tryed body.setGravity( 0 ); but I still can't control its height in this case. So I think I need to rewrite states like CONTROLS_STATE_FORWARD or maybe use AUX states. How can I do this? Link to comment
manguste Posted July 20, 2011 Share Posted July 20, 2011 Try out one of the following: Create physical PlayerActor, set gravity flag for its body to 0 (the actor should be simulated physically). This part is fine. After that: Get user input with engine.controls.getState(CONTROLS_STATE_JUMP). Right now your character is literally hanging in the air. That is why he cannot jump. You need to apply an impulse or force to his body that corresponds to user input. [*] If you do not need fully simulated physical character, you can use PlayerSpectator or PlayerSpectator + PlayerPersecutor for a third person character. Link to comment
Gryphon_de Posted July 22, 2011 Author Share Posted July 22, 2011 Thanks! I'm try playing with linear velocity right now) Link to comment
Recommended Posts