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

Fixed FlowerGun AddRelativeForce #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixed FlowerGun AddRelativeForce #179

wants to merge 1 commit into from

Conversation

tiagosomda
Copy link

The bullet flower in the flower gun is not working.
It always shoots the flower to the same direction.

That is due to a regression in the Untiy Physics Engine.
They are aware of the bug:
https://issuetracker.unity3d.com/issues/auto-sync-transforms-does-not-sync-correctly-when-using-addrelativeforce

However this fix is not even on 2018.1 beta yet.
So it would be nice to add this fix to NewtonVR.
Adding Physics.SyncTransforms() flushes any rotations to the physics engine which then applies the new rotation of the flower and makes it go the right way.

@tiagosomda
Copy link
Author

tiagosomda commented Mar 28, 2018

Note that we can also fix this without calling the Physics.SyncTransform()
by changing the BulletForce to a float (instead of a Vector3) and adding the force like this:

bullet.GetComponent().AddForce(bullet.transform.forward*BulletForce);

@BernsteinA
Copy link

@tiagosomda is this still necessary?

@tiagosomda
Copy link
Author

I haven't tried it recently.

However, Unity says they have fixed the bug on their side:
https://issuetracker.unity3d.com/issues/auto-sync-transforms-does-not-sync-correctly-when-using-addrelativeforce

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

Successfully merging this pull request may close these issues.

2 participants