Motion Fails Me Again

What is the best way to make a character move with out the problem of flying through walls and “energy” build up?

I had this script:

cont = GameLogic.getCurrentController()
owner = cont.owner
#declare sensors
fwd = cont.getSensor(“fwd”)
back = cont.getSensor(“back”)
left = cont.getSensor(“left”)
right = cont.getSensor(“right”)
jump = cont.getSensor(“jump”)
shift = cont.getSensor(“shift”)
RaySensor = cont.sensors[“RAY”]
#declare actuators
move = cont.getActuator(“movement”)

#declare ints for movement
Speed = .09
Speed2 = .15
Speed3 = .12
FB = 0
LR = 0
SH = 0
#declare event handlers
if fwd.isPositive():
FB = Speed
elif back.isPositive():
FB = -Speed
if left.isPositive():
LR = Speed2
elif right.isPositive():
LR = -Speed2
if jump.triggered:
owner.JU=Speed3
elif RaySensor.positive:
owner.JU=0
if shift.isPositive():
FB = Speed2
move.setDLoc(0.0 ,FB, owner.JU, True)
move.setDRot(0.0, 0.0, LR, True)
GameLogic.addActiveActuator(move, True)
GameLogic.addActiveActuator(“movement”, True )

But it doesn’t work with the new blenders. And will scripted movement go through “walls”?

Or is there a way so that if you walk into a wall, the servo “energy” would build up?

Thanks

Well, I would only need the script if I can’t get the servo motion actuator to work right.
And the thing with Blender python is that I wrote this script off a tutorial, thus I have no clue what the difference between 2.4 and 2.5+ (Don’t worry I will read Agoose’s thingy)

On my “player” I have him elevated above the ground, does that change the build up? Iso I need to switch it. Sadly I can’t try this, my “blender computer” recently had a problem that has to do with 7zip(I was trying Solar’s Demo. Cool game, but the stuff to extract it crippled my computer). If you have the time, try making a cube with the sevro motion use the distance constraint t oget abovethe ground and run into a wall. Thanks

I get frustrated looking at tutorials too. Most I find are old and written in > 2.49 and some are in 2.5+. The best way to tell is just read the first line. If it says ‘GameLogic’ anywhere, its 2.49. If the first line says ‘import bge’, its 2.5+. Whenever I open a tutorial if it says ‘GameLogic’ anywhere I just shut it down straight away as I figure it’ll just confuse me :stuck_out_tongue:

To be honest I’ve never used servo motion. I’ll have to give it a shot when I’m not at work haha. Possibly tonight :wink:

Ahhh, I got my Blender computer back! :slight_smile:

Anyway. . . If the object with the servo actuator is off the ground, it has “build up”. When it touches the ground it is fine!

Thanks for the Script version recognizing!