Thread: Quick Question
View Single Post
  #2  
Old 04-24-2008, 08:51 AM
nige777 nige777 is offline
Member
 
Join Date: Nov 2007
Location: UK
Posts: 78
RE: Right answer, wrong question!

Thanks for the suggestion, it works really well. Unfortunately I posted the question when I was half asleep, so I apologies for the fact that I will now have to ask you a revised question. I actually need to be able to dismount the the truck and move around. I control the truck with a joypad with the head ori of the view set to mouselook and envisage controlling the view in the same way when I dismount. Here's the joypad script I'm using to drive the FLT:

Code:
#Use joystick to control FLT navigation
def UpdateMovement():
    
    #Get the joystick position
    x,y,z = joy.getPosition()
    
    #Get the twist of the joystick
    twist = joy.getTwist()
        
    #Using the z value off the twist control for up and down
    if abs(y) > 0.3 or abs(y) < -0.3:
        SetThrottle(-y)
        
    if abs(y) <0.3 and abs(y) >-0.3:
        SetThrottle(0)
    
    if abs(twist) > 0.2 or abs(twist) < -0.2:
        steer(twist*70)
        steerWheel(-twist*65)
    
    elif abs(twist) < 0.2 or abs(twist) > -0.2:
        steer(0)
        steerWheel(0)

#UpdateJoystick every frame
vizact.ontimer(viz.FASTEST_EXPIRATION,UpdateMovement)
So what I think I am asking is how do I mount and dismount from the truck while using the same controls to manipulate the main view.

Thanks for your patience,

Nige
Reply With Quote