9faq

Switching characters

I have an exec function that switches the player's character between George and Timmy on the fly at the push of a button. The only problem is that I am using terrain and when I change character the new character falls through the floor underneath the terrain. I'm assuming it's to do with the default settings I have for the heights etc as they are on different eye levels and didn't want a floating Timmy. The default properties I set are as follows:

Timmy:
DrawScale=1.0
BaseEyeHeight=25.0
CollisionRadius=+00015.000000
CollisionHeight=+00025.000000
CrouchHeight=+20.00

George:
DrawScale=0.540
BaseEyeHeight=54.0
CollisionRadius=+00024.000000
CollisionHeight=+00054.000000
CrouchHeight=+39.00

Can anyone help me by telling me what I need to change to stop my characters falling through the world and bugging out when i change next to a wall?

-Steph Charij

I managed to fix the falling through the level, thanks to John, it was due to not initialising a location to use for spawning my new Pawn (George or Timmy). I just simply created a new var vector called position and then got the location of the pawn before it was destroyed and stored it in the variable.

I am still having the problem with checking collisions with walls and roofs to prevent me being able to switch characters (otherwise I fall through the wall and start flying around an inverted level with no pawn as if a spectator). If anyone can help me with this issue I would very much appreciate it.

360 controller input

Managed to get the controller to carry out instructions on menu's now after following John's tutorial. These are the relative buttons on the control pad and the state which referes to what is being done to the button, testing for these in the key press function can then be done to carry out other functions in your code.

Button Name Key code State information
A 200 1= pressed
B 201 1 = pressed
X 202 1 = pressed
Y 203 1 = pressed
LB 204 1 = pressed
RB 205 1 = pressed
Back 206 1 = pressed
Start 207 1 = pressed
Dpad up 212 3 = pressed
Dpad right 213 3 = pressed
Dpad down 214 3 = pressed
Dpad left 215 3 = pressed

-Martin Allen

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License