In Bullet Props, you’ll find some movement properties where you can input equations. It works using Godot’s Expression system.
y = x+1
The Expression is x+1. This is what you have to input.
y is the result. x is the variable.
You can input many math functions such as log, sin, abs, exp, cos,…
Godot will turn this string into a computable equation and return the result y.
<aside> ✅ If you want to see what your equation looks like, input it in the calculator at the bottom of the page.
</aside>
x is the time since spawn. y is the deviation from the straight line the bullet would make if it had no equation. But you can just take it as “x is the x position, y is the y position in a Vector2()”.
In the end, the position of the bullet will change to follow the curve described by the equation.
You can make infinitly complex equations, but the most common and useful ones are just cos(x) or sin(x) .
Instead of modifying the position, this changes the rotation. This is because Godot doesn’t support unreal numbers and so equations of non-functions aren’t possible. Basically, stuff such as spirals cannot be described with functions so the Direction Equation above won’t work.
To simulate non-function equations, the Angular Equation changes the bullet rotation.
x is the time since spawn. y is added to rotation at each frame.
It’s theorically possible to do any non-function with that, but you won’t find help online because this system has been created by me but the only thing I know how to do is a spiral and a circle.