Method calls
Pick a method, supply its target and arguments, then Compile the call into C#.
On this page
A collected coin has work to hand off: count it, refresh the HUD, and play a sound. Each handoff is a method call.
The problem
Section titled “The problem”PlayerController.CollectCoin calls four neighbors. The coin arrives as a parameter, the score and HUD are class fields, and audio is optional. Each call needs the correct object and arguments at the correct position in the execution chain.
When to reach for it
Section titled “When to reach for it”Use a call when another method already owns the behavior you need. Pick call to invoke it. Pick method group when you need the method itself as a delegate value, with no parentheses or argument list.
The context sensitive checkbox starts on. The menu then offers methods the open type can already call: its own methods, inherited methods, and statics already available to the file. Turn it off to browse the hierarchical project palette by namespace and type. An instance method found there starts with an empty target pin because Round Trip will not guess which object should receive it.
See it
Section titled “See it”
PlayerController.CollectCoin.
- Open a method graph and right-click an empty part of the canvas. The action menu opens at the click.
- Search under call. Expand the inherited or static group when that is where the method lives. Turn off context sensitive only when the scoped list does not contain the method.
- Choose an overload. The selected overload decides which argument pins appear.
- For an instance call, connect the object to the target pin. Calls on the current object already carry their implicit target. You can also drag the object’s output pin onto empty canvas: its member menu offers the type’s methods with a call action, and typing in its filter lists the type’s own matches before nested ones.
- Connect or type each argument. A generic method asks you to choose each type argument before the call is created.
- Put an impure call on the exec chain. Pure calls produce data without exec pins.
- Press Compile in the toolbar. The call is inserted at its execution-flow position and the file is parsed back into the graph.
A member read off a call’s result stays one pill. collision.GetContact(i).normal.y reads back as one GET pill, y with normal in its eyebrow, wired from the GetContact result, the same node you place by dragging that result pin. A constructor that starts with : this(...) or : base(...) shows that call as a node titled with the called type, with one input per argument, named and typed by the called constructor’s parameters.
What it writes
Section titled “What it writes”When it goes wrong
Section titled “When it goes wrong”When it goes wrong
| Symptom | Check | Fix |
|---|---|---|
| Compile leaves the call pending | Look for an empty target, argument, or generic type slot. | Supply every required value, then Compile again. |
| The method is missing from the short list | Check whether context sensitive is enabled. | Turn it off and browse the namespace and type hierarchy. |
| Method group is disabled | Check whether the method is generic. | Use a non-generic method group or finish the edit in C#. |