Skip to content

Fixed FlowerGun AddRelativeForce#179

Open
tiagosomda wants to merge 1 commit into
TomorrowTodayLabs:masterfrom
tiagosomda:FlowerGun-Fix-AddRelativeForce
Open

Fixed FlowerGun AddRelativeForce#179
tiagosomda wants to merge 1 commit into
TomorrowTodayLabs:masterfrom
tiagosomda:FlowerGun-Fix-AddRelativeForce

Conversation

@tiagosomda
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

@tiagosomda is this still necessary?

@tiagosomda
Copy link
Copy Markdown
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