Documentation & Tutorials
  • Pivec Labs Documentation & Tutorials
  • Assets for Game Creator 1
    • Action Pack 1
      • Action List
        • Misc Actions
        • Object Actions
        • TMP Actions
      • Examples
        • Example 1 TMP
        • Example 2 Objects
        • Example 3 Actions
    • Action Pack 2
      • Action List
        • Camera Actions
        • Graphics Actions
        • Audio Actions
        • Video Actions
      • Triggers
      • Components
      • Examples
        • Example 1 - Camera
        • Example 2 - Camera FPS
        • Example 3 - Graphics
        • Example 4 - Sounds
        • Example 5 - Audio Player
        • Example 6 - Video Player
    • Action Pack 3
      • Action List
        • Day/Night Cycle
        • Light Control
      • Components
      • Examples
        • Example 1 - Day Night Cycle
        • Example 2 - Light Control
    • Accessibility Module
      • Components
      • Setup
      • Auditory Aids
        • Closed Captions for Sounds
        • Volume Control with Tags
        • Multiple Volume Controls
      • Motoric Aids
        • Configurable Tank Camera
        • On-Screen Multi-Function Joystick
        • Dynamic Touchstick
        • Multi-Function Touchstick
      • Cognitive Aids
        • Parental Controls with Password
        • Dyslexia Font Options
        • Motion Sickness Prevention
        • Gameplay Speed and Sensitivity
      • Visual Aids
        • Colour Picker
        • Variable Text Size
        • Object Outlining
        • Colour Switching
        • Colour Correction
    • Mobile Components
      • Actions
        • Haptics
        • Camera
        • TouchSticks
        • Gyroscope
        • Utilities
      • Triggers
        • Touch Gestures
      • Conditions
      • Components
      • Prefabs
      • Examples
        • Example 1 Haptics
        • Example 2 Cameras
        • Example 3 Gestures
        • Example 4 Controls
        • Example 5 Steering Wheel/Pedals
        • Example 6 Gyroscope Controls
        • Example 7 Gyroscope Camera
        • Example 8 Utilities
        • Example 9 AutoRun
      • Extras
    • UI Components
      • Canvas Components
        • Canvas Animations
        • 3D Models on a Canvas
        • Video on a Canvas
      • Animating UI Elements
        • Cross Fade Elements
        • Slide Elements
        • Shake UI Element
        • Tooltips
      • Text Mesh Pro & uGUI Text
      • Colour Picker Component
      • Mini Map Component
        • MiniMap QuickStart
        • Fullscreen Map
        • Adding Markers
        • Adding Labels
      • System Info Panel
        • SysInfo Quickstart
        • Using SysInfo Toggle
      • Main Menu Templates
        • Customising the Prefabs
        • Load/Save System
        • Comic Strip Example
    • Developer Tools
      • Time Manager
        • Actions & Conditions
      • Waypoint System
      • Click to Spawn Objects
      • In-Game Console
      • In-Game Screen Capture
    • Turn Based Module
    • VR Module GC1
  • Assets for Unity
    • Developer Tools for Unity
      • Click to Spawn
      • In-Game Screen Capture
      • In-Game Console
    • Mini Map System
      • MiniMap Quickstart
      • Map Parameters
      • Adding Makers
  • Tutorials
    • Tutorials for Game Creator 1
      • Installing and Updating Modules
      • Adding Actions to the Button Bar
      • Changing the Graphics for TouchStick
      • Adding Passwords to Player Actions
      • Using the Colour Picker with Variables
      • Creating a 3D Inspection Panel for Game Objects
      • Customising the UI MiniMap
      • Creating a toggle for the SysInfo Panel
      • Simple Player Run on Left Shift Down
      • Pan Follow Camera with Keyboard
    • Tutorials for Unity
  • ANNEX
    • Roadmap
    • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. Assets for Game Creator 1
  2. Action Pack 1
  3. Examples

Example 2 Objects

PreviousExample 1 TMPNextExample 3 Actions

Last updated 5 years ago

Was this helpful?

Example 2 demonstrates 2 main features, how to move 3D game objects and how to drag 3D objects with the mouse. Both actions are included in Action Pack 1. This example includes a Trigger on Start and on Player Enter/Exit Triggers on Cube1, Cube2, and Cube3 (being the moving platforms).

Actions 1, 2, &3 on Start Trigger: Each of these Actions contain the same script from Action Pack 1, that being Move Object by Distance. They select Cube 1, 2, & 3 respectively. Action1 moves Cube 1 a value of 23 on the x axis, at a speed of 5, and waits 3 seconds before returning to the original position. A wait of 3 seconds is then added and a restart Action allowing the Cube to move indefinitely. Action2/Cube2 moves on the y axis with a value of -6 (as it starts from the top) and at a speed of 3. Action 3/Cube3 also moves on the y axis, but has a value of 6 as it starts at the bottom. Both Actions wait for 3 seconds and return, and also have a wait of 3 seconds before restarting the Action.

Player Enter/Exit Triggers and Actions: On each Cube, there is a Trigger for Player Enter, and a Trigger for Player Exit. These Triggers and subsequent Actions are part of the Game Creator Core. On Player Enter, we change the Player Transform to be parented to the Cube, and on Player Exit, we reset the Parent. This can be acheived other ways, but it allows the player to be moved with the moving platform.

Once the Player has traversed the wall using the moving Platform, we look to Action 4 which will enable the dragging of 3D Game Objects.

Action 4: Drag Object with Mouse. We have set up 6 Objects to be able to be dragged with the mouse. For each Action/Object you simply add the GameObject to the Object field, select Allow Dragging, and choose which mouse button you require. This work best when the Camera Orbit is either switched off or set to a different Mouse button than the Drag. Now when the Mouse is over (it uses raytracing to enable this) the Object, hold down the button and drag the object on the x and y axis, and move the player back with the button still down to move on the z axis. This effect is better in first person but also work in third.