In this scene we demonstrate the use of the Drag Instructions and interact with Rigidbodies. We also show how the Spawn Game Object is used.
The on Start Trigger calls two Action lists, Rotate Cube and Float Sphere. The Rotate Cube uses the Constant Rotate Instruction and should be in its own Action as it will never finish. Instructions after this will therefore never get called. As written earlier, this differs from Game Creator 1, where the core Actions were Mono Behaviors, and could utilize co-routines and Invokes. Game Creator 2 cannot do this.
Trigger (on Key down 1) calls the Repel Rigid Body by Tag, and will repel the three spheres around the Cube. The mode and force can be changed I the Instruction, and the Trigger can be executed multiple times.
Triggers (on Key down 2, 3, and 4) toggle another 3 separate Triggers active and inactive. We have done it this way, as each of the other Triggers use the Mouse as input, and you may not always want to do the same thing with the same Mouse button. Hence activating and inactivating Triggers with a Toggle Trigger appears to be the simplest way to achieve this.
Trigger (on Key down 2) activates the Trigger Drag Any RB. This Trigger is set to Mouse While Pressing Left Button, to continuously drag any Rigidbody with a force amount of 10.
Trigger (on Key down 3) activates the Trigger Drag Cube by Tag. This Trigger is also set to Mouse While Pressing Left Button, to continuously drag any Game Object with the Tag of Cube. You can also set the axis to be dragged on.
Trigger (on Key down 4) activates the Trigger Spawn Prefab. This Trigger is set to Mouse Press Left
Pivec Labs |
||
|
||
|
||
|
||
|
|
|
Since |
2005 |
|
Awards |
||
Website |
||
|
|
|
|
|
|
ALL RIGHTS RESERVED © 2022 |