How can I perform Compact Operations on Variables in Blueprint?
I want to alter my variables a few times before a single operation is performed, so how can I do compact statement in blueprint? Is it as simple as getting the Variable the setting it again?
No by default, you would need to code such nodes yourself in C++ (dont panic its quite easy, you just add something to funtion to convert it to blueprint node) but im not sure if blueprint system and UHT support primitive type varable pointers in order to set blueprint varable just by inputing it.
Hmm seems youāre right, I canāt make multiple changes to a variable before something is done with it.
Kind of sucks really, I canāt get the current state of a variable and add to it. Does that mean Iām going to have to create multiple variables, which are all āolderā versions of one another, and do it that way?
under each input there is a checkbox that lets you pass by reference. if you check that, the circle pins turn to diamond shapes and dragging off of one of those diamond pins will give you a context sensitive list of functions that you can perform on pass by reference variables.
Here is where Iām stuck now⦠notice the first āSet Alphaā function. How would I go about using it here, or would I have to condense all of this into a special node like the above?
im not really sure what you are trying to do, but doing something multiple times per tick sounds like the kind of thing you would want to do in C++ for efficiency.
right now, you are multiplying Alpha vectors X and Y by itself every tick, which will exponentially increase the values of Alpha very quickly. unless some other code limits or resets Alpha, this seems like a problem. are you trying to add a velocity to alpha?
Hereās the thread, which Iāve linked to the code. You can see that it makes multiple changes to a variable as itās passed through the code, in a specified sequence, before outputting that value to either Angular or Linear velocity. (Alpha is Angular, Accel is Velocity). Both values are acceleration for the āOmegaā or āVelocā Vectors which are the actual Angular/Linear velocities respectively.
Iāve been trying to program it as a movement component for some time now, but having bugger-all luck.
I should add that the C++ there IS wrong of course, I still have limited knowledge and have a lot to learn about Unrealās Movement Comps. Theyāre⦠complex.
The Psuedo-Code I have however is taken from a working game (by a proper programmer)
Since I catch myself using such operations a lot and hating the time wasted everytime I have to use the āBranchā node, Iāve recreated these operators (and some more) in the form of a Plugin which you can find here:
The nodes Iāve added have branching built-in when needed and removes the necessity to output a boolean value to link to a Branch node all the time when simply checking something, pretty much like the āIsValid?ā node.
Just copy the āBxBLExtensionsā folder into the Plugins folder of your project, restart the editor and nodes will be there.