Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Someone help me with this line of code? (CFrames)

local new_cframe = cf((last + (part_cframe.lookVector*(t*2000)) + Vector3.new(0, last.Y - 5*t^2 - 10, 0)))

So, allow me to explain my problem.

I need the second portion of this line of code (Vector3.new(...)) to be traveling in negative Y direction no matter where the lookVector is pointing. Apparently I wrote it wrong so that the second bit is relative to the first bit, and it isn't always negative in world coordinates or whatever.

Someone please enlighten me?

1 answer

✓ Accepted answer

If you want to ensure something is negative, you can take the absolute value of it and multiply it by -1.

So your line should look around the terms of :

Vector3.new(0, math.abs(last.Y - 5*t^2 - 10) * -1, 0)

1 comment

0

Thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.