Body part tweaks
This commit is contained in:
parent
4e3dd7041d
commit
1c42e7b305
@ -18,13 +18,13 @@ transform = Transform( 2.5, 0, 0, 0, 2.5, 0, 0, 0, 2.5, 0, 0, 0 )
|
|||||||
shape = SubResource( 1 )
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="DownFrontLeft" parent="." instance=ExtResource( 2 )]
|
[node name="DownFrontLeft" parent="." instance=ExtResource( 2 )]
|
||||||
transform = Transform( -0.965926, 0, -0.258819, 0, 1, 0, 0.258819, 0, -0.965926, 1.3, 1, 4.2 )
|
transform = Transform( 0.965926, -1.45851e-07, -0.258819, -1.50996e-07, -1, -1.77636e-15, -0.258819, 3.90806e-08, -0.965926, 1.3, 1, 4.2 )
|
||||||
|
|
||||||
[node name="Mesh" parent="DownFrontLeft" index="0"]
|
[node name="Mesh" parent="DownFrontLeft" index="0"]
|
||||||
transform = Transform( 0.2, 0, 3.72529e-09, 0, 0.2, 0, -3.72529e-09, 0, 0.2, 0, 0, 0 )
|
transform = Transform( 0.2, 0, 3.72529e-09, 0, 0.2, 0, -3.72529e-09, 0, 0.2, 0, 0, 0 )
|
||||||
|
|
||||||
[node name="DownFrontRight" parent="." instance=ExtResource( 2 )]
|
[node name="DownFrontRight" parent="." instance=ExtResource( 2 )]
|
||||||
transform = Transform( -0.965926, 0, 0.258819, 0, 1, 0, -0.258819, 0, -0.965926, -1.3, 1, 4.2 )
|
transform = Transform( 0.965926, -1.45851e-07, 0.258819, -1.50996e-07, -1, 1.77636e-15, 0.258819, -3.90806e-08, -0.965926, -1.3, 1, 4.2 )
|
||||||
|
|
||||||
[node name="OmniLight" parent="DownFrontRight" index="1"]
|
[node name="OmniLight" parent="DownFrontRight" index="1"]
|
||||||
transform = Transform( 1, 3.13083e-13, 0, -3.09641e-13, 1, -5.59552e-14, 0, 5.59552e-14, 1, -0.680858, -1.19209e-07, -1.38872 )
|
transform = Transform( 1, 3.13083e-13, 0, -3.09641e-13, 1, -5.59552e-14, 0, 5.59552e-14, 1, -0.680858, -1.19209e-07, -1.38872 )
|
||||||
|
@ -7,10 +7,15 @@ onready var anim = get_node("Mesh/AnimationPlayer")
|
|||||||
func action():
|
func action():
|
||||||
anim.play("ArmatureAction")
|
anim.play("ArmatureAction")
|
||||||
|
|
||||||
|
# Apply a slight impulse here too
|
||||||
|
var offset = touch_area.global_transform.origin - base.global_transform.origin
|
||||||
|
var direction = base.transform.basis.y * 1.0
|
||||||
|
|
||||||
|
base.apply_impulse(offset, direction)
|
||||||
|
|
||||||
|
|
||||||
func push(body):
|
func push(body):
|
||||||
# We multiply by 0.1 because we only want it to spin slightly, it should mostly go up
|
var offset = touch_area.global_transform.origin - base.global_transform.origin
|
||||||
var offset = transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.1
|
|
||||||
var direction = -base.transform.basis.y * 5.0
|
var direction = -base.transform.basis.y * 5.0
|
||||||
|
|
||||||
base.apply_impulse(offset, direction)
|
base.apply_impulse(offset, direction)
|
||||||
|
@ -12,10 +12,16 @@ func _ready() -> void:
|
|||||||
func action():
|
func action():
|
||||||
anim.play("ArmatureAction")
|
anim.play("ArmatureAction")
|
||||||
|
|
||||||
|
# Apply a slight counter force
|
||||||
|
var offset = transform.basis.xform(Vector3.ZERO) #transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.5
|
||||||
|
var direction = -(base.transform.basis.y - base.transform.basis.z).normalized() * 0.5
|
||||||
|
|
||||||
|
base.apply_impulse(offset, direction)
|
||||||
|
|
||||||
|
|
||||||
func push(body):
|
func push(body):
|
||||||
# We multiply by 0.1 because we only want it to spin slightly, it should mostly go up
|
# We multiply by 0.1 because we only want it to spin slightly, it should mostly go up
|
||||||
var offset = transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.1
|
var offset = transform.basis.xform(Vector3.ZERO) #transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.5
|
||||||
var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 5.0
|
var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 5.0
|
||||||
|
|
||||||
base.apply_impulse(offset, direction)
|
base.apply_impulse(offset, direction)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
[ext_resource path="res://3D Input/beinimage.png" type="Texture" id=4]
|
[ext_resource path="res://3D Input/beinimage.png" type="Texture" id=4]
|
||||||
|
|
||||||
[sub_resource type="BoxShape" id=1]
|
[sub_resource type="BoxShape" id=1]
|
||||||
extents = Vector3( 0.665551, 2.37819, 1.38274 )
|
extents = Vector3( 0.666, 2.378, 1.555 )
|
||||||
|
|
||||||
[sub_resource type="SphereShape" id=2]
|
[sub_resource type="SphereShape" id=2]
|
||||||
radius = 0.108468
|
radius = 0.108468
|
||||||
@ -19,7 +19,7 @@ transform = Transform( 1, 8.74228e-08, -3.82137e-15, 0, -4.37114e-08, -1, -8.742
|
|||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
[node name="PartCollider" parent="." index="0"]
|
[node name="PartCollider" parent="." index="0"]
|
||||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.37252, -0.314289 )
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.37252, -0.326758 )
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="TouchArea" parent="." index="1"]
|
[node name="TouchArea" parent="." index="1"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user