First of all, sorry for my bad english, I'm learning.

My problem is, I have to throw a rigid body, like a ball in a Ballistic Curve, simulating a rotation (When I'm in the angle of 90 degrees, the ball should be throwing to the left, not to the up).

Example of the correct angle: https://drive.google.com/file/d/1a8H3GGz6RnY7RpZMa2rob76XsJTjCN94/view?usp=sharing

I'm using the current code:

``````extends Node

var angleStop
var rpm = 4

func _on_Button_pressed():
var impulse; var lock
lock = Vector2(0, 0)

\$groundBody/ballBody.apply_impulse(lock, impulse)

func get_impulse_vector(angleStop, rpm, size):

angleStop = 90 * PI/180
var fx = size * cos(angleStop) * radius * 0.10471975511965977 * rpm
var fy = -size * sin(angleStop) * radius * 0.10471975511965977 * rpm
var out = Vector2(fx, fy)

return out
``````

With this code, the ball is thrown to the up, not to the left, someone can explain me why ?

in Engine

Probably because you are setting this wrong in this line

https://imgur.com/a/EYE8JDB

Radians are used internally, and they assume 0 is to the right?

by (953 points)
In your code snippet, the function `get_impulse_vector` always return `Vector2(0, -1)`, so the direction is not LEFT but UP.
``````var fx = size * cos(angleStop) * radius * 0.10471975511965977 * rpm #fx = 0
you can change the `angleStop` to 0, `fx` to `-fx` to get the right direction.