0 votes

My function recieves 3 information from raycasting.
I would like to emit particles in the normal direction, and more importantly, in the refraction direction.
The problem is, that the emission direction changes when the object rotates, I guess because the direction is in world coordinates.

func shot(_position : Vector3, _impulse : Vector3, _normal : Vector3):
    apply_impulse(_position, _impulse)
    $Particles.translation = _position
    $Particles.rotation = _normal
    #$Particles.process_material.direction = _impulse - _normal * (_normal.dot(_impulse) * 2)
    $Particles.process_material.direction = _normal
    $Particles.restart()

Thanks in advance.

Godot version 3.4.4
in Engine by (12 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.