| View previous topic :: View next topic |
| Author |
Message |
SteK
Joined: 12 Mar 2008 Posts: 4
Digg It |
Posted: Sun Apr 13, 2008 11:38 am Post subject: Unreal mouse |
|
|
hello there,
i want to use the pitch and roll to look around unreal 3 (for a university project) and i've assigned the roll to the left and right arrow keys to look on the x axis but i want to use the pitch as the mouse y axis, any surggestions for code to use?
any help will be much appreciated
ps am not a very experienced coder so with any code an explination of how it works(unless ded simple) would also be very helpful
cheers _________________ I thought what i'd do was become one of those deaf mutes, or would I? |
|
| Back to top |
|
 |
kappa
Joined: 11 Apr 2008 Posts: 12
Digg It |
Posted: Mon Apr 14, 2008 7:25 pm Post subject: |
|
|
well if i understood correctly this is what you are looking for if i diddnt sry
tell me what i got wrong
| Code: | If Wiimote.RawForceZ > 4 Then Mouse.y = Mouse.y - 0.001 * 2 * (Wiimote.RawForceZ - 4)
If Wiimote.RawForceZ < -4 Then Mouse.y = Mouse.y - 0.001 * 2 * (Wiimote.RawForceZ + 4) |
basicly this moves your mouse up and down. if you change all 4s to higher number you make wiimote less sensitive and vice versa. and those 2s control mouse speed.
this two lines of code ware originaly from here
| Code: | // Code for playing FPS Games
// Posted by Fred_31_ from the Kasten's script |
_________________ xfire: bulletdeal |
|
| Back to top |
|
 |
WakeUpWolfgang
Joined: 27 Apr 2008 Posts: 1
Digg It |
Posted: Sun Apr 27, 2008 8:23 pm Post subject: |
|
|
hay you stole my idea I have written the code to do it. i am witting a tourtol on how to it for UT. But i am using the Nunchuk for WASD and the pitch and roll for the mouse.
| Code: | // WASD for fsp games
w = Wiimote.Nunchuk.JoyY < -0.5
a = Wiimote.Nunchuk.JoyX < -0.5
s = Wiimote.Nunchuk.JoyY > 0.5
d = Wiimote.Nunchuk.JoyX > 0.5
// This is the code that moves your mouse
if var.xRot > var.xCutoff then mouse.x = mouse.x - .001 * var.speed * (var.xRot - var.xCutoff)
if var.xRot < -var.xCutoff then mouse.x = mouse.x - .001 * var.speed * (var.xRot + var.xCutoff)
if var.zRot > var.zCutoff then mouse.y = mouse.y - .001 * var.speed * (var.zRot - var.zCutoff)
if var.zRot < -var.zCutoff then mouse.y = mouse.y - .001 * var.speed * (var.zRot + var.zCutoff) |
sorry for the spelling |
|
| Back to top |
|
 |
|