I need help with 2d character movement. I want the character to be able to walk along slopes without sticking (friction), and not to stick to 90 degree vertical slopes.
This is my current script:
import bge from bge import logic from bge import events cont = logic.getCurrentController() own = cont.owner x_linv = own.getLinearVelocity() z_linv = own.getLinearVelocity() if logic.keyboard.events[events.AKEY] == 2: x_linv = -7.5 if logic.keyboard.events[events.DKEY] == 2: x_linv = 7.5 if cont.sensors["g"].positive and logic.keyboard.events[events.SPACEKEY] == 1: z_linv = 10 own.setLinearVelocity([x_linv, 0.0, z_linv], 1)
Can someone perhaps edit it for it to work, or is there a better script?