@DJM said:
i dont know what to pass to "lookat" and "hitnormal" vector.
Me neither, because I don't know how your system is set up :)
For lookat you need to send camera look direction, which is camera global basis.z
For hitNormal you need to send that forward direction you wanted the particle to stretch along in the first place. If your script already orients "impactnormal" scene (somewhere, somehow) then we'll need to see this code to figure out the correct vector. Assuming "imapactnormal" is already oriented so that forward axis is its local z axis then the whole thing would go as follows:
# get camera node
var cam = get_tree().get_root().get_camera()
# get camera look direction
var lookat = cam.global_transform.basis.z.normalized()
# set look direction to shader
particles.process_material.set_shader_param("lookat", lookat )
# assuming the forward direction is our current local z axis, send it to shader
var hitNormal = global_transform.basis.z.normalized()
particles.process_material.set_shader_param("hitNormal", hitNormal)
Note that camera lookat needs to be sent every frame, because it changes as you rotate the camera. So this code should go into _process()