## What is the best way to get the anchor point to the center of a line in Video Copilot for Saber?

Moderators: Disciple, zlovatt

AKASGaming
Posts: 1
Joined: July 6th, 2020, 3:54 pm

I'm trying to make this saber spin from the center while constantly having the anchor point between the two points (Core Start and Core End) I prefer having to run an expression to do this but if there's another way please let me know!

PS: I'm using this with this current expression:

Code: Select all

``````x1 = effect("Saber")("Core Start")
x2 = effect("Saber")("Core Start")

y1 = effect("Saber")("Core End")
y2 = effect("Saber")("Core End")

transform.anchorPoint([x1/y1], [x2/y2])``````

With error: "undefined value used in expression (could be an out of range array subscript )"

sshahriyari
Posts: 30
Joined: January 16th, 2017, 11:59 pm
Contact:
AKASGaming wrote:
July 6th, 2020, 3:58 pm

I'm trying to make this saber spin from the center while constantly having the anchor point between the two points (Core Start and Core End) I prefer having to run an expression to do this but if there's another way please let me know!

PS: I'm using this with this current expression:

Code: Select all

``````x1 = effect("Saber")("Core Start")
x2 = effect("Saber")("Core Start")

y1 = effect("Saber")("Core End")
y2 = effect("Saber")("Core End")

transform.anchorPoint([x1/y1], [x2/y2])``````

With error: "undefined value used in expression (could be an out of range array subscript )"

Try this :

Code: Select all

``````var x1 = effect("Saber")("Core Start")];
var y1 = effect("Saber")("Core Start");

var x2 = effect("Saber")("Core End");
var y2 = effect("Saber")("Core End");

xResults = (x1 + x2) / 2;
yResults = (y1 + y2) / 2;
[xResults, yResults];``````