01-12-2016, 07:47 PM
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.
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.