Skip to content
This repository has been archived by the owner on Mar 2, 2020. It is now read-only.

Commit

Permalink
first spring release
Browse files Browse the repository at this point in the history
  • Loading branch information
QbieShay committed Feb 25, 2018
1 parent 702f9a9 commit cc82192
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 4 additions & 5 deletions SpringArm.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cc82192

Please sign in to comment.