Use Compatibility instead of Forward+

This commit is contained in:
antimundo 2024-06-10 18:44:52 +02:00
parent dd4389e63e
commit 0b7e8b8178
No known key found for this signature in database
GPG key ID: F83F260F8F88F0BC
3 changed files with 8 additions and 5 deletions

View file

@ -119,4 +119,6 @@ fullscreen={
[rendering]
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
environment/defaults/default_clear_color=Color(0.101961, 0.101961, 0.101961, 1)

View file

@ -3,7 +3,8 @@
[ext_resource type="Script" path="res://scenes/game_world/bullet_hole.gd" id="1_a25ui"]
[ext_resource type="Texture2D" uid="uid://cqospwtedgwrg" path="res://assets/images/hole.png" id="2_bi3vi"]
[node name="BulletHole" type="Decal"]
size = Vector3(0.2, 0.2, 0.2)
texture_albedo = ExtResource("2_bi3vi")
[node name="BulletHole" type="Sprite3D"]
transform = Transform3D(0.15, 0, 0, 0, 0.15, 0, 0, 0, 0.15, 0, 0, 0)
modulate = Color(1, 1, 1, 0.784314)
texture = ExtResource("2_bi3vi")
script = ExtResource("1_a25ui")

View file

@ -93,8 +93,8 @@ func _shoot(damage: float) -> void:
var bullet_hole_instance = bullet_hole.instantiate()
target.add_child(bullet_hole_instance)
bullet_hole_instance.global_transform.origin = raycast.get_collision_point()
bullet_hole_instance.look_at(position + Vector3.FORWARD, raycast.get_collision_normal())
bullet_hole_instance.global_transform.origin = raycast.get_collision_point() + raycast.get_collision_normal() * 0.001
bullet_hole_instance.look_at(bullet_hole_instance.global_position + raycast.get_collision_normal(), Vector3.FORWARD )
if target.is_in_group("Enemy"):
target.health -= damage