Hi guys, i used linxgls’s ledge hang/climb example and implimented it into my game, but i need it to work from any direction not just on the Y axis, currently I can only climb from one side of my ledge, i need it to work on ledges approached from any angle.
here’s the code as it apears and works in my game.
Could i get a hand rewriting it to work from any position.
Thanks in advance, i’m going to make a big update(and possible demo) with voidkeepers once I have some of these character systems working.
Here’s a link to the thread with the example I used and modded to my character.
import GameLogic as g cont = g.getCurrentController() own = cont.owner ledge_find = cont.sensors['ledge_find'] climb = cont.sensors['climb_ledge'] hang = cont.actuators['hang_animation'] climb_up = cont.actuators['ledge_climb_animation'] tonorm = cont.actuators['backtonorm'] climb_positive = climb.positive and climb.tap if ledge_find.positive: hitpos = ledge_find.hitPosition hitx = hitpos hity = hitpos hitz = hitpos hity = hity - 1.3 hitz = hitz - 4 hitpos = [hitx,hity,hitz] own.position = hitpos own.suspendDynamics() cont.activate(hang) own['ledged'] = True if own['ledged'] == True and climb_positive and own['pressed_climb'] == False: cont.deactivate(hang) cx = own.position cy = own.position + 3 cz = own.position + 7 climbed = [cx,cy,cz] own.position = climbed cont.activate(climb_up) own['pressed_climb'] = True if own['ledge_climb'] == 20: own['ledged'] = False own.restoreDynamics() cont.activate(tonorm) # own.state = 5