Let’s say I have a function to create a hitbox. One of the parameters is for knockback direction.
function createHitbox(otherParametersBlahBlahBlah, knockbackDirection)
--create hitbox
end
I then create a hitbox, and create a touched event for it. Then, I put the knockbackDirection as the, well, knockback direction, when it comes time to apply it.
Now, I’ll call it to create a hitbox for an object, applying it in the opposite direction the object is facing:
createHitbox(parametersAndStuff, -object.CFrame.lookVector)
The thing is, this object is actually moving. So, my question is, when it goes to try and apply knockback does it
- See that I passed in -object.CFrame.lookVector, and go find it’s current value, or
- Use the value of -object.CFrame.lookVector at the time the function was called?