- Edited
Hi,...I'm working on my simple FPS template for my possibly upcoming FPS projects.... ...is based on the TwistedTwigleg FPS tutorial (Thanks for that great work!).....when I followed the first part and simplified the player script for my needs on a simpler fps. ....so I have a shoot function where I shooting ray to the walls and floor...to spawn some sparks (instanced particle node) .....ray shoot great...StaticBodies/walls/floors are recognized reliably....but sparks particles appears always in the center of the wall or floor and not where the ray projectile hit wall/floor. I'm using simple script
func shoot(delta):
var point = ray_projectile.get_collision_point().normalized()
var collider
if Input.is_action_just_pressed("shoot"):
ray_projectile.set_cast_to(Vector3(0, 0, -150))
if ray_projectile.is_colliding():
collider = ray_projectile.get_collider()
var hit_new = hit.instance() #sparks particle
collider.add_child(hit_new)
print(collider)
....so far half-works but not at the ray hit position :( ....Thanks for your help guys.