For example, to map it to spare bar, you right click and add “input space bar” and hook it up to your set node. You could possibly use a multigate to make it so each press swaps between cameras.
That should be pretty easy as well. So many ways to tackle it. If you only have a handful of cameras I’d go with “Switch on Int” and then store an Int of your current camera. Then on left subtract 1, on right add one. You could make it looping by checking if you go over, or (more elegant) by using modulus to automatically make it look using math.
hmm that is strange. if you debug, are both events firing?? There should be nothing about the script that cares where it came from.
If you are unsure how to debug, after starting PIE, in the BP window you should be able to select an instance of your BP in the upper right in a drop down then the lines should highlight when you press buttons
Both events are firing but only the one through the Increment change the camera, the Decrement does nothing to change the camera, the lines just fire through to the current camera.
hmm that is very odd. and you are sure the decrement one is hooked up to the “switch on int” node just like the increment one? Ill try a test here in a bit.
edit do absolute after the %. you are probably just stuck in negative numbers which is always returning 0
Do absolute int after the % node. It is just stuck returning negative numbers once you go to the left of 0.
You may want something different if you need to avoid the symmetrical behavior this causes around 0. Should be easy to check for if you need to. maybe just start the int at like 5billion
Yes, I just set it up here exactly the same and it is working. If your is not working for me, hover over the value coming out of the absolute node and see what it is as you change both ways.
Also does it work if you set the default value of ‘int’ to be something large like 1000? Then left will cause it to be 999 instead of -1. probably not the issue but worth a try.
ok strange. so what happens to the value coming directly out of the “decrement node” after each left press? Is that not chanigng? seems that way which is odd.
I mean hover the mouse over the blue circle on the right side of the “decement” node and then press buttons and make sure the execution lines fire and see if the value is actually decrementing on left press.
And I mean doing it manually by doing “set int” and then using “int - 1” as the set value.
Those both set the value of int before the switch. Then the switch reads the modified value of ‘int’ with the modulus calculation performed on it.