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
#2
You only need to override ApplyTransformRotation() and ApplyTransformPosition(), that should be sufficient. The only exception I see is when you want the controller to be able to switch splines like featured in the runner example.

In alternative, override UserAfterInit() and UserAfterUpdate() to set both position and rotation.

Edit: Examined the code and you're right, transform is used for getting rotation in Refresh(). So I consider adding GetTransformRotation() and GetTransformPosition() as new virtual methods to CurvyController.cs. If you want to modify CurvyController.cs by yourself, just add those two methods and your code should be fine after the next update. On the other side, must your GO holding the controller keep unchanged? Otherwise you could simply use UserAfterUpdate() and sync local transform to your other GO.

Also I'm curious what special purpose makes this neccessary.
Reply


Messages In This Thread
RE: How to make controller affect another object than the one controller is attached to - by Jake - 01-12-2016, 07:47 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: