I have a function that takes in the Y Orientation of a part. This function needs to take that number and translate it into a Vector3 value that a BodyForce can use to move a player in the direction the part is facing.
For example, if the BodyForce has a total of 10,000 units to distribute between the X and Z axes and the part’s orientation is 0, it needs to set the Z axis of the BodyForce to 10,000. An orientation of 180 would produce -10,000 on the Z axis. An orientation of -90 would produce -10,000 on the X, while 90 would produce 10,000 on the X axis. Any orientation between these values would need to split the 10,000 between the X and Z axes.
I’m sure there is a mathematical function that can calculate this, but I can’t figure it out - how could I do this?
Hey, I tried setting the Force to the LookVector of the bouncer part, but it doesn’t actually seem to do anything. The code is working, because the sound plays and the console outputs appear, but the player isn’t moved at all. Any suggestions?