I went on a bit but Iām trying to cover all of the bases.
What is the current node ID? Iām going to assume the nodes are numbered. If thereās only 1 node with that ID then thatās the only node that currently gets checked because the ray cast is a subevent of that event. If thatās the case I donāt know why it has a for each object
If you want to check all of the nodes then you need move the events out of the for each object to their own subevent so itās even with the ray cast events.
For each
ā id equals
ā ray cast
That way the ray cast event gets triggered when the IDs donāt match. IDK if thatās your intention. I donāt think you want to check previous nodes. That would be behind the car. Maybe just nodes greater than that current node. Again, Iām not clear on the process. It becomes slightly tricky when the nodes reach the last node and starts back at 0. The next node would be 0 not greater than the last.
Note: when a ray cast is inverted unlike most conditions it doesnāt become a negative condition in the way that an inverted collision condition becomes not in collision. An inverted ray cast condition becomes āpick the farthestā instead of the nearest. Since itās inside a for each object itās only checking 1 object at a time and possibly only 1 object bc of the ID event. That object would always be the nearest and the farthest because itās the only object being looked at.
If you want to know if the ray cast found something you can add a boolean variable. Set it to false before the ray cast and add the action to the ray cast event to set it to true. Or you can compare the x,y result values and see if theyāre the same values. I prefer the boolean. Itās less vague as to the purpose.
Since inverting a ray cast doesnāt work like other events, you can put it inside the Not condition. That would invert the result. If the condition was true the Not would make it false. If the ray cast returned false then it would return true and trigger any events.
Each event uses resources and time. The ray cast uses more than other conditions. Unless, youāre checking for the nearest and farthest object from within a list of objects then both events arenāt needed.
If you want to know if the ray cast is false then you can use the variable approach. You donāt need to use both a ray cast and a ray cast with a Not condition because the first ray cast already checked for the object. Thereās no need to check it twice. The variable approach uses less resources then a 2nd ray cast inside of a NOT event.
I mentioned the NOT condition as a way to explain the difference between inverting it. Itās best to either use a ray cast or use a ray cast inside of a NOT condition. It depends on the projects needs. Theyāre both checking the same thing. So, only 1 needs to be done. You can check if that event failed or succeeded with one of the variable approach. Thereās no need to do it twice.
I agree with you that the variable return values should be able to use any variable type especially as they simplified the variable system to treat variables more as equals.