Spawning origin

You know how you can change the emit origin and have that origin rotate with the object? does anyone have an example of a way to make a rotating origin for spawning objects? I know how to spawn an object offset from a position so I can spawn it to the right of a player but unlike the emit’s origin I can’t spawn things from different positions based on the angle of a player. So does anyone know a way I could do this? Maybe an expression I could use?

The spawn behavior uses X and Y inputs, it does not have a origin.

I know, I was wondering how to make something like origin for spawning objects

I changed my post to give you a better idea of what I was talking about

Ah yes, I use the math in many things but I dont have an example specifically for this.
Let me share you expression code on to do this, this involves using 2 expressions:

(C*Math.cos(B*(Math.PI/180)))+A

A = This X
B = Angle
C = Distance

(C*Math.sin(B*(Math.PI/180)))+A

A = This Y
B = Angle
C = Distance

image

1 Like

If you want the bullet to rotate in the direction you are spawning to, then you could input the angle into the spawn input. Then the bullet can extract the starting value and set its own rotation.

image

1 Like

Oh that’s cool, I didn’t know you could do that.

distance from what?

Distance from the origin in pixels (This X and This Y).

1 Like