I want to make to make an empty game object as a game controller. How would I access scripts on other game objects. Also is it possible to invoke functions and also invokerepeat?
Yes that is possible. The easiest way to call a function (or get/set a property) on a component of some gameobject, is to simply drag that gameobject in the editor. Doing that, will give you a popup menu to chose what function or property you want to use and create a node for it 🙂
Let me know if that is what you were after.
As for using Invoke and InvokeRepeat Unity’s functions, yes that is also possible in a similar manner the the above. You can simply drag and drop the gameobject which has the script of which you want to call the Invoke functions and select the Invoke (or InvokeRepeat) from the menu of available functions that will popup. Doing so, a node will be created in the flowscript editor.
Please let me know if these help, or if you need further directions.
Thanks.
I realise that this means you have to create your own c# scripts in monodevelop with public methods but,I was wondering if you could call from a flowscript to invoke or invokerepeat something in the other flowscript.
Hey,
Sorry for the late reply, but I got ill in bed.
Now I see what you mean. If you want to call an event in flowscript B from flowscript A, then what you can use is “Send Event” node in flowscript A, along with the “Events/Custom Event” node in flowscript B.
Here is an image of what I mean:
The only change you will need to make is for the “Send Event” node on the top (which resembles flowscript A), to assign or connect the “Target” property if that node, to the other flowscript object instead of leaving it to the default “Self”.
Then that other flowscript (bottom), will be using a “Custom Event” node to catch the event send to it from the first flowscript (top)
Please let me know if that helps, or if you need further explanation of this.
Thanks.
No problem on getting back to me,hope you are feeling better. Is there any way to simulate an invoke repeating on the called flowscript custom event,for example if I called it and I wanted a game object to start moving across the screen?
Hello again.
Calling “Break” from another flowscript would be very similar to what we’ve done here for calling “Start”. That is, that you will need to use another “Send Event” node from that other flowscript (A) and use another “Custom Event” node in this flowscript (B), then connect the output of the new “Custom Event” Node to the “Break” port.
It’s exactly the same setup as the screenshot above, but with another pair of “Send Event” and “Custom Event” nodes.
Please let me know if that helps, or if you need further clarification or info.
Thanks!