Is sense where it cuts off. from point_current to hit.position .
Yes I can decrease
@export var trail_point_density := 0.05 , which will increase points_count .
That makes sense, which would be updated by camera_root.is_aiming.
the target project using currently this logic, which I’m looking if I should keep it or reduce it to only camera length, or collision point.
( it’s from Full Code for Rick O'Shea Released )
func _physics_process(_delta: float) -> void:
if Input.is_action_just_pressed(GameConstants.INPUT_SHOOT):
if not camera_root.is_aiming:
return
var target: Vector3
if ray_cast_3d.is_colliding():
target = ray_cast_3d.get_collision_point()
print("Use Collision Point")
else:
var camera: Camera3D = ray_cast_3d.get_parent()
target = camera.global_position + (-camera.global_transform.basis.z * 1000)
print("Use camera length")
var bullet: Bullet = bullet_scene.instantiate()
Game.current_level.add_child(bullet)
bullet.global_transform = muzzle.global_transform
bullet.look_at(target, Vector3.UP)
bullet.fire_at(target)
artemisia:
func _physics_process(_delta: float) -> void:
if Input.is_action_just_pressed(GameConstants.INPUT_SHOOT):
if not camera_root.is_aiming:
return
var target: Vector3
if ray_cast_3d.is_colliding():
target = ray_cast_3d.get_collision_point()
print("Use Collision Point")
else:
var camera: Camera3D = ray_cast_3d.get_parent()
target = camera.global_position + (-camera.global_transform.basis.z * 1000)
print("Use camera length")
var bullet: Bullet = bullet_scene.instantiate()
Game.current_level.add_child(bullet)
bullet.global_transform = muzzle.global_transform
bullet.look_at(target, Vector3.UP)
bullet.fire_at(target)
I don’t see how is this related to ballistic arcs. Doing direct raycasts from the camera has no use whatsoever for arcs. To actually determine the hit point you need to do a series of raycasts from every point of the arc to the next point, starting with the first point, up to the moment something is hit.
1 Like
Another great point, I didn’t think through to actual arrow trajectory.
For now I could just fake it by store Hit.position as target and tween between muzzle and target(hit.position).
1 Like