From cc82192ed8a6262b646fb12291ffd42de92c933d Mon Sep 17 00:00:00 2001 From: QbieShay Date: Sun, 25 Feb 2018 17:05:57 +0100 Subject: [PATCH] first spring release --- README.md | 9 ++++++++- SpringArm.gd | 9 ++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 45fc0f6..5d6adb3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,13 @@ A configurable spring arm node for Godot Engine # How to use it -Currently, only length and height and smoothness can be set. + As soon as the spring is given a target, it will start following the target and looking at the target. +Currently, the spring node position itself on the back of the target, at given height and length For the spring to work, it is needed to give it a collision shape. + + - Spring Max Length : How far the spring node will stay on the target's back vector + - Spring Max Height : How high the spring node will stay on the target's up vector + - Smoothness : How smooth the movement of the spring node should be + - Look At Target : Should the spring node look at the target + - Interpolate Physic Frame : Should the spring node interpolate between pysics frames diff --git a/SpringArm.gd b/SpringArm.gd index 17aadf2..ff0538a 100644 --- a/SpringArm.gd +++ b/SpringArm.gd @@ -5,10 +5,10 @@ export var spring_max_length = 10 export var spring_max_height = 5 export var smoothness = 0.9 export var look_at_target = true -export var look_at_target_smoothness = 0.0 -export var rotate_with_target = true -export var rotate_with_target_smoothness = 0.0 -export var angle_from_target_forward = -180.0 +#export var look_at_target_smoothness = 0.0 +#export var rotate_with_target = true +#export var rotate_with_target_smoothness = 0.0 +#export var angle_from_target_forward = -180.0 export var interpolate_physics_frames = true setget set_interpolate_physics_frames, get_interpolate_physics_frames @@ -58,7 +58,6 @@ var next_phys_position var physic_delta func _physics_process(delta): time_since_last_physic_process = 0 - print(str(delta)) var wanted_pos = _compute_movement() if(interpolate_physics_frames): #Use move and slide to calculate the right position and then move back