[ad_1]
I used to climb for a short while, like solely a month or two as a result of my girlfriend was doing it on the time, the coach used to name me “warthog” insinuating I used to be a type of meatheads that did not care about climbing clues and simply exausted traying to muscle each wall with no finesse in any respect however aside from that it was enjoyable, I wanna make my climbing system have complexities that may be related to actual life climbing, what are the primary issues that i can add this weekend?
#climbing part
var wall_incline
var is_wall_in_range = false
onready var head_ray =$Mesh/HeadRay
func climbing():
if is_on_wall():
if Enter.is_action_pressed("ahead"):
checkWallInclination()
vertical_velocity = Vector3.UP * (power + (agility * 0.15))
#horizontal_velocity = course * 1
is_climbing = true
is_swimming = false
if not head_ray.is_colliding() and never is_wall_in_range:#vaulting
an.play("TPose",mix, power)#vaulting animation placeholder
elif not is_wall_in_range:#regular climb
an.play("climb",mix, power)
else:
an.play("crawl incline", mix, power)
horizontal_velocity = course * climb_speed * 3.5
else:
is_climbing = false
func checkWallInclination():
if get_slide_count() > 0:
var collision_info = get_slide_collision(0)
var regular = collision_info.regular
if regular.length_squared() > 0:
wall_incline = acos(regular.y) # Calculate the inclination angle in radians
wall_incline = rad2deg(wall_incline) # Convert inclination angle to levels
if regular.x < 0:
wall_incline = -wall_incline
# Test if the wall inclination is inside the specified vary
is_wall_in_range = (wall_incline >= -60 and wall_incline <= 60)
else:
wall_incline = 0 # Set to 0 if the traditional shouldn't be legitimate
is_wall_in_range = false
else:
wall_incline = 0 # Set to 0 if there isn't a collision
is_wall_in_range = false
[ad_2]