So, I've wanted to make a climb button in my game, if a character is close to a climbable object, and presses space, he climbs up on it.
This is my source:
if spacekey()=1 and Range < 15
phy delete character controller player
phy make box character controller player, object position x(player), object position y(player), object position z(player), 5, 15, 5, 1, 200, 45
phy move character controller player, 150.0
phy delete character controller player
phy make box character controller player, object position x(player), object position y(player), object position z(player), 5, 15, 5, 1, 2, 45
endif
Player is my character, range is the range from the object. I wanted to make the character climb up on the object, using the Physics controller, by deleting my character controller, making a new one with a greater height to stairs, pushing my character forward, after this deleting my character controller, and making a normal one once again. The problem is that my character isn't climbing up on the object unless I take out the last delete character controller and make character controller. If I delete those two lines, works perfectly, but I can't leave it this way, cause then my character will be able to climb up on any object later on.
Any ideas?