Added tank model for player
This commit is contained in:
parent
46398bd8fa
commit
5437b1c6f3
17 changed files with 66235 additions and 14 deletions
|
@ -23,7 +23,7 @@ func _physics_process(delta):
|
|||
if Input.is_action_just_pressed("shoot"):
|
||||
var b = Bullet.instance()
|
||||
owner.add_child(b)
|
||||
b.transform = $CollisionShape/Tank/BulletGenerator.global_transform
|
||||
b.transform = $CollisionShapeTop/Top_tank/BulletGenerator.global_transform
|
||||
b.velocity = -b.global_transform.basis.z * b.muzzle_velocity
|
||||
|
||||
var space_state = get_world().direct_space_state
|
||||
|
@ -33,7 +33,7 @@ func _physics_process(delta):
|
|||
var intersection = space_state.intersect_ray(rayOrigin, rayEnd) # Set variable for cursor position
|
||||
if not intersection.empty(): # Make sure there is a intersection with raycast
|
||||
var pos = intersection.position
|
||||
$CollisionShape.look_at(Vector3(pos.x, pos.y, pos.z), Vector3(0,1,0))
|
||||
$CollisionShapeTop.look_at(Vector3(pos.x, pos.y, pos.z), Vector3(0,1,0))
|
||||
|
||||
if direction != Vector3.ZERO:
|
||||
direction = direction.normalized()
|
||||
|
|
19052
Objects/Player-tank/model/Bottom_tank.dae
Normal file
19052
Objects/Player-tank/model/Bottom_tank.dae
Normal file
File diff suppressed because one or more lines are too long
1065
Objects/Player-tank/model/Bottom_tank.dae.import
Normal file
1065
Objects/Player-tank/model/Bottom_tank.dae.import
Normal file
File diff suppressed because it is too large
Load diff
12509
Objects/Player-tank/model/Top_tank.dae
Normal file
12509
Objects/Player-tank/model/Top_tank.dae
Normal file
File diff suppressed because one or more lines are too long
1065
Objects/Player-tank/model/Top_tank.dae.import
Normal file
1065
Objects/Player-tank/model/Top_tank.dae.import
Normal file
File diff suppressed because it is too large
Load diff
BIN
Objects/Player-tank/model/aiStandardSurface10.material
Normal file
BIN
Objects/Player-tank/model/aiStandardSurface10.material
Normal file
Binary file not shown.
BIN
Objects/Player-tank/model/aiStandardSurface11.material
Normal file
BIN
Objects/Player-tank/model/aiStandardSurface11.material
Normal file
Binary file not shown.
BIN
Objects/Player-tank/model/aiStandardSurface12.material
Normal file
BIN
Objects/Player-tank/model/aiStandardSurface12.material
Normal file
Binary file not shown.
BIN
Objects/Player-tank/model/aiStandardSurface14.material
Normal file
BIN
Objects/Player-tank/model/aiStandardSurface14.material
Normal file
Binary file not shown.
BIN
Objects/Player-tank/model/aiStandardSurface2.material
Normal file
BIN
Objects/Player-tank/model/aiStandardSurface2.material
Normal file
Binary file not shown.
BIN
Objects/Player-tank/model/aiStandardSurface3.material
Normal file
BIN
Objects/Player-tank/model/aiStandardSurface3.material
Normal file
Binary file not shown.
BIN
Objects/Player-tank/model/aiStandardSurface6.material
Normal file
BIN
Objects/Player-tank/model/aiStandardSurface6.material
Normal file
Binary file not shown.
BIN
Objects/Player-tank/model/aiStandardSurface7.material
Normal file
BIN
Objects/Player-tank/model/aiStandardSurface7.material
Normal file
Binary file not shown.
BIN
Objects/Player-tank/model/aiStandardSurface9.material
Normal file
BIN
Objects/Player-tank/model/aiStandardSurface9.material
Normal file
Binary file not shown.
31460
Objects/Player-tank/model/tank.dae
Normal file
31460
Objects/Player-tank/model/tank.dae
Normal file
File diff suppressed because one or more lines are too long
1065
Objects/Player-tank/model/tank.dae.import
Normal file
1065
Objects/Player-tank/model/tank.dae.import
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,13 +1,13 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://Objects/Player-tank/Player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Objects/Player-tank/model/Bottom_tank.dae" type="PackedScene" id=2]
|
||||
[ext_resource path="res://Objects/Player-tank/model/Top_tank.dae" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="BoxShape" id=1]
|
||||
extents = Vector3( 1.29, 1, 2.428 )
|
||||
|
||||
[sub_resource type="CubeMesh" id=2]
|
||||
|
||||
[sub_resource type="SpatialMaterial" id=3]
|
||||
albedo_color = Color( 1, 0, 0, 1 )
|
||||
[sub_resource type="BoxShape" id=2]
|
||||
|
||||
[node name="PlayerTank" type="KinematicBody"]
|
||||
script = ExtResource( 1 )
|
||||
|
@ -15,13 +15,18 @@ script = ExtResource( 1 )
|
|||
[node name="Camera" type="Camera" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 20.7405, -7.28392e-07 )
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="." groups=["player", "tank"]]
|
||||
[node name="CollisionShapeBottom" type="CollisionShape" parent="." groups=["player", "tank"]]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="Tank" type="MeshInstance" parent="CollisionShape" groups=["tank"]]
|
||||
mesh = SubResource( 2 )
|
||||
skeleton = NodePath("../..")
|
||||
material/0 = SubResource( 3 )
|
||||
[node name="Bottom_tank" parent="CollisionShapeBottom" instance=ExtResource( 2 )]
|
||||
transform = Transform( -1.44248e-06, 0, 33, 0, 33, 0, -33, 0, -1.44248e-06, 0, -1.90625, 0 )
|
||||
|
||||
[node name="BulletGenerator" type="Position3D" parent="CollisionShape/Tank"]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0032903, 0.375606, -1.3599 )
|
||||
[node name="CollisionShapeTop" type="CollisionShape" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.572825, 0 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="Top_tank" parent="CollisionShapeTop" instance=ExtResource( 3 )]
|
||||
transform = Transform( -1.44248e-06, 0, 33, 0, 33, 0, -33, 0, -1.44248e-06, 0, -2.74403, 0 )
|
||||
|
||||
[node name="BulletGenerator" type="Position3D" parent="CollisionShapeTop/Top_tank"]
|
||||
transform = Transform( -1.32459e-09, 0, -0.030303, 0, 0.030303, 0, 0.030303, 0, -1.32459e-09, 0.124162, 0.0831104, -9.97006e-05 )
|
||||
|
|
Loading…
Reference in a new issue