0
Answered

Plus Equals Assignment Operator

Jack 2 years ago updated by Ex-Crow 10 months ago 7

I know about the addon, that isn't what I'm asking, Ok?


Is there some alternative in Bolt for +=

Some formula, some combination of math units? Lacking assignment operators is making my life a-lot harder. Have I missed something? So many code samples use assignment operators such as this one and

-variablename


And i cannot replicate it


Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

making a fps controller and it works fine. Just can't find a way to clamp the x rotation and apply speed also without a jittering.


I try to replicate coding examples like this but can't:

  1. var rotSpeed : float;
  2. private var rotVertical : float = 0;
  3.  
  4. function Update()
  5. {
  6.     rotVertical += Input.GetAxis("Mouse Y") * rotSpeed;
  7.     transform.localEulerAngles.x = Mathf.Clamp(-rotVertical, -60, 60);
  8. }

 

Any help would be appreciate to help me understand what i'm doing wrong

These aren't part of official Bolt, but have been added by the community:

https://support.ludiq.io/communities/5/topics/1643-boltaddonscommunity-now-bolt-14-compatible

Or from:

https://github.com/RealityStop/Bolt.Addons.Community


Among the other units, it has x++, ++x, --x, x--, and x += y in the Increment, Decrement, and Plus Equals nodes.

I don't know how to install it. I can't understand the instructions. Is it because i'm on a mac none of the files are working?

Go to the Releases tab and download the .unitypackage that matches the .NET version of your project.  Either drag and drop it into your project, or use the Import Asset Package menu item from Unity to bring it into your project.


The instructions on the main page are only for those that wish to build it from sourcecode.

Is there any other way in Bolt to do this (+=) without Community Addons? I'm using Bolt 2 a5

"A += B" is just "A = A + B" so you just have to reference "A" twice and use the "Add" unit.