petit fix

This commit is contained in:
osquallo 2018-07-29 08:28:48 +02:00
parent d83058a3f7
commit fca412affc
2 changed files with 51 additions and 49 deletions

View file

@ -62,10 +62,12 @@ func process_input(delta):
func process_movement(delta): func process_movement(delta):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
dir.y = 0 dir.y = 0
dir = dir.normalized() dir = dir.normalized()
# vel.y += delta*GRAVITY # vel.y += delta*GRAVITY
var hvel = vel var hvel = vel
hvel.y = 0 hvel.y = 0
@ -82,7 +84,7 @@ func process_movement(delta):
hvel = hvel.linear_interpolate(target, accel*delta) hvel = hvel.linear_interpolate(target, accel*delta)
vel.x = hvel.x vel.x = hvel.x
vel.z = hvel.z vel.z = hvel.z
# vel = move_and_slide(vel,Vector3(0,1,0), 0.05, 4, deg2rad(MAX_SLOPE_ANGLE)) # vel = move_and_slide(vel,Vector3(0,1,0), 0.05, 4, deg2rad(MAX_SLOPE_ANGLE))
var collision_info = move_and_collide(vel * delta) var collision_info = move_and_collide(vel * delta)
if collision_info: if collision_info:
vel = vel.bounce(collision_info.normal) vel = vel.bounce(collision_info.normal)
@ -97,12 +99,12 @@ func process_movement(delta):
get_node( "../../GUI/HUD/Jauges/trauma/ProgressBar" ).value += 0.25 get_node( "../../GUI/HUD/Jauges/trauma/ProgressBar" ).value += 0.25
if get_node( "../../GUI/HUD/Jauges/trauma/ProgressBar" ).value >= 100: if get_node( "../../GUI/HUD/Jauges/trauma/ProgressBar" ).value >= 100:
get_node( "../../GUI/HUD/Jauges/oubli/ProgressBar" ).value += 0.25 get_node( "../../GUI/HUD/Jauges/oubli/ProgressBar" ).value += 0.25
# obj.get_node( "MeshInstance" ).get_surface_material(0).albedo_color = Color( collision_info.normal ) # obj.get_node( "MeshInstance" ).get_surface_material(0).albedo_color = Color( collision_info.normal )
# if obj.has_method( "hit" ): # if obj.has_method( "hit" ):
# obj.hit( collision_info.position, collision_info.collider_velocity ) # obj.hit( collision_info.position, collision_info.collider_velocity )
# print(str(collision_info.collider.get_class())) # print(str(collision_info.collider.get_class()))

View file

@ -2,11 +2,11 @@
[ext_resource path="res://scenes/Game/Character/Character.gd" type="Script" id=1] [ext_resource path="res://scenes/Game/Character/Character.gd" type="Script" id=1]
[sub_resource type="SphereShape" id=2] [sub_resource type="SphereShape" id=1]
radius = 0.897042 radius = 0.897042
[sub_resource type="SphereMesh" id=1] [sub_resource type="SphereMesh" id=2]
custom_aabb = AABB( 0, 0, 0, 0, 0, 0 ) custom_aabb = AABB( 0, 0, 0, 0, 0, 0 )
radius = 1.0 radius = 1.0
@ -15,7 +15,7 @@ radial_segments = 64
rings = 32 rings = 32
is_hemisphere = false is_hemisphere = false
[node name="Character" type="KinematicBody"] [node name="Character" type="KinematicBody" index="0"]
transform = Transform( 1, 0, 0, 0, 0.589355, 0, 0, 0, 1, -0.0409546, 1.06519, 6.02408 ) transform = Transform( 1, 0, 0, 0, 0.589355, 0, 0, 0, 1, -0.0409546, 1.06519, 6.02408 )
input_ray_pickable = true input_ray_pickable = true
@ -55,8 +55,8 @@ _sections_unfolded = [ "Transform" ]
[node name="CollisionShape" type="CollisionShape" parent="." index="1"] [node name="CollisionShape" type="CollisionShape" parent="." index="1"]
transform = Transform( 0.364654, 0, 0, 0, -2.47558e-08, -0.566346, 0, 0.313738, -1.37139e-08, 0.0505983, 4.32164, 0 ) transform = Transform( 0.364654, 0, 0, 0, -2.47558e-008, -0.566346, 0, 0.313738, -1.37139e-008, 0.0505983, 4.32164, 0 )
shape = SubResource( 2 ) shape = SubResource( 1 )
disabled = false disabled = false
_sections_unfolded = [ "Transform" ] _sections_unfolded = [ "Transform" ]
@ -72,7 +72,7 @@ lod_min_distance = 0.0
lod_min_hysteresis = 0.0 lod_min_hysteresis = 0.0
lod_max_distance = 0.0 lod_max_distance = 0.0
lod_max_hysteresis = 0.0 lod_max_hysteresis = 0.0
mesh = SubResource( 1 ) mesh = SubResource( 2 )
skeleton = NodePath("..") skeleton = NodePath("..")
material/0 = null material/0 = null