Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set velocity direction separately from rotation #214

Open
jkstrawn opened this issue May 4, 2024 · 1 comment
Open

Set velocity direction separately from rotation #214

jkstrawn opened this issue May 4, 2024 · 1 comment

Comments

@jkstrawn
Copy link

jkstrawn commented May 4, 2024

I'm trying to create particles that float straight up, with each particle having a random static rotation. It seems like a fairly straightforward situation. I've tried a lot of different behavior combinations but as far as I can tell this isn't possible - because the speed behavior relies on rotation for setting its direction. Is that correct?

@andrewstart
Copy link
Contributor

That is correct. The Path, Speed, and Acceleration movement behaviors rely on the initial rotation to pick their direction. The simplest solution would probably be to make some sort of "ExtraLateStaticRotationBehavior" (that you may or may not use in combination with a regular rotation behavior) to set the rotation after it has been read by your movement initialization. Make a copy (or subclass) of StaticRotationBehavior and set its order to BehaviorOrder.Late + 1 (or 6), and register it on Emitter. The NoRotationBehavior does this exactly, but uses a defined rotation instead of a random rotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants