Skip to content

Commit

Permalink
Merge pull request #285 from JohnnyThunder2/main
Browse files Browse the repository at this point in the history
Fixed issue where Projectile would spawn at world orgin instead of bullet_point in Godot 4.3
  • Loading branch information
Phazorknight authored Sep 25, 2024
2 parents 63a9e82 + ea6c1dc commit 7c65954
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion COGITO/Wieldables/toy_pistol.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ bus = &"SFX"

[node name="Bullet_Point" type="Node3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, -1.81899e-12, 0, 1, 0, 0, 0, 1, 0.277335, 0.0601448, 0.00182778)
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.277335, 0.0601448, 0.00182778)

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
Expand Down
2 changes: 2 additions & 0 deletions COGITO/Wieldables/wieldable_toy_pistol.gd
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ func action_primary(_passed_item_reference : InventoryItemPD, _is_released: bool
# Spawning projectile
var Projectile = get_projectile()
bullet_point.add_child(Projectile)
Projectile.set_global_position(Vector3(bullet_point.global_position.x,bullet_point.global_position.y,bullet_point.global_position.z))
Projectile.global_transform.basis = bullet_point.global_transform.basis
Projectile.damage_amount = _passed_item_reference.wieldable_damage
Projectile.set_linear_velocity(Direction * projectile_velocity)
Projectile.reparent(get_tree().get_current_scene())
Expand Down

0 comments on commit 7c65954

Please sign in to comment.