Then explain how it still accesses that camera after I kill the first one. See my demo video.
Thatâs how itâs explained for spawning new objects in all the tutorials I watched.
I donât know about any of that other stuff you said. Iâve gotten so much bad information around here so far that I would need a better explanation before I believed it. How do you know this for certain? You canât just look while the game is running.
It appears to work very well now. Thank you very much!
Iâll study what you did and learn from it. Appreciated.
move the tank to a different location in the hidden layer and you will see
the camera is accessed even though its in a hidden layer
it also happens for steering actuator where itâs possible to target to an obj in a hidden layers
How right you are. I guess you know what youâre talking about. My apologies for any doubts.
So when you add a script to an And and itâs branched off of a sensor that also points to another And going to an actuator, the python script loads and runs before the actuator is initiated? Iâm just trying to understand the flow of logic and order of execution.
While I have your attention, is there a simple way to set the order of execution of actuators on an object?
It says in the console (Window > Toggle System Console). Once I saw that, I looked at your tank on the hidden scene and saw that it tried adding new overlays.
Glad I could help!
Back in Blender 2.5 when I was using it, it did it in the order that you added the logic bricks (madness, I know). Itâs probably still the same now.
Youâre not going to like it⌠but yes, you can do it with Python. Or, if my above statement is correct, then you can add the actuators in order and hope that they activate in the same order.
May I ask why you need a specific order? Most things are going to start happening at the same time anyway, so actuator order shouldnât make any difference. Iâm not even sure if sending messages in a different order will result in the sensors receiving them in the same order.
Or, to put it another way, let us know what youâre trying to achieve and hopefully we can come up with a way that doesnât rely on actuator order.
Iâm just trying to understand how Blender handles the logic bricks. I was thinking of this initially in terms of spawning, by plugging two Edit Object actuators into the same And, where one removes an object and the other adds one. I was just considering ways to implement the camera parenting.
I appreciate the help. Iâll post again when I have another problem or question, which I;m sure I will before long.
there is a bookmark symbol in the controller that sets the order
you can also switch states and use delay sensors.
and here is a topic about the game loop by Professor Monster
The way I understand it, you say on one frame what you want to happen, and it happens by the next frame. For example, you send a message on frame 1. On frame 2, any sensors that are listening for that message are active. Or, you add an object on frame 1, it exists by frame 2.
Thatâs why I mentioned the order doesnât matter that much, because it all happens by the next frame.
This is also why firing off multiple of the same message doesnât activate things multiple times, since they all just make the sensor active on the next frame.
Having objects appear the next frame is not ideal if you want to spawn lots of things and parent them all together, so Python has a function on the âadd object actuatorâ to instantly add, which means itâs immediately available to move/parent/etc.
Due to the way I wrote that camera script, it wonât matter if the old tank still exists when the new one is added. The camera wonât automatically change to the new tank though, if youâre watching the old one when it dies.
Take what I say with a grain of salt. Most of this comes from practical experience having used Blender extensively many years ago. Some of what I recall might be wrong, or have changed in newer versions (particularly in UPBGE). I remember at the time when struggling through problems that other peoples little insights to the workings helped me figure out why things were reacting weirdly. I hope my messages provide the same assistance.
Thank you @TheDave, you are a big help. For me, understanding how things work is important. Your explanation makes it all a little bit clearer.
I will be posting another python-related question in a minute or two. Perhaps you can look at that?