Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make controller affect another object than the one controller is attached to
#5
Actually the GO setup is implementing a state machine through object activation/deactivation and is instantiated from game data. It does its job but has its flaws.

Enemy (higher level scripts): this root object never moves
- EnemyPrefab (Only MeshRenderer and colliders): the object to move
- ExitSpawnMovement (instantiated from a prefab with preconfigured Move controller script and a movement script): position of this object places (for example) a spline at the correct location
- ApproachMovement (idem)
- AttackMovement (idem)

Only one ***Movement object is active at a time.

I would have used the SplineController in place of our own move controller and put the spline on the same object... which is a bad idea right now and why I would have loved to be able to choose which object is moved by the controller. I'll certainly rewrite a controller for my special case but thought about the suggestion above which *might* have worked off the shelf.
Reply


Messages In This Thread
RE: How to make controller affect another object than the one controller is attached to - by Aberdyne - 01-13-2016, 01:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 PM
Last Post: _Aka_
  Add noise to spline controller movement DekoGames 2 10 02-06-2024, 01:28 PM
Last Post: DekoGames
  Removing the objects behind an object alms94 6 6 12-06-2023, 09:31 PM
Last Post: _Aka_
  Getting object on spline Position when Spline has coordinates larger than 2000 velikizlivuk 5 10 09-05-2023, 01:01 PM
Last Post: velikizlivuk

Forum Jump: