Sorry if this seems like a mess.
My intended goal/result
My intended result is as follows:
-
I click a GUI Button that says “JOIN” which turns into “LEAVE” (DONE)
-
Take away the player controls during “JOIN” and give it back with “LEAVE” (DONE)
-
My character then walks onto the pad perfectly on center (Done, but not perfectly centered)
-
My character then tweens to face the front ( front isn’t not yet clear in the first gif, look at test dummy and 2nd gif for intended result) (NOT DONE)
Issues
I only used pathfinding as a quick way to make the player character walk onto the pad from any angle by using the pathfinding service and doing ComputeAsync and WalkTo. If there is a better method please let me know.
This is as far as I got and the pathfinding doesn’t perfectly center itself on the training mat:
https://gyazo.com/9da1edabb3fa835fb480251b54c50b52
The bigger issue however is how do I take the angle of entry and tween the correct angle adjustment so that it faces the frontbar I added on this picture?
Green = Angle of Entry (can be from all angles, green beam is relative to character’s front)
Orange = The angle I want to tween to after pathfinding finishes
Yellow/Blue = top head view of a roblox noob
https://gyazo.com/130048c3fef4cc3bb3586ec9f1b6ce12
TL; DR:
- pathfinding not perfect, stops just short of center (the + shaped mat’s position center)
- no idea how to tween to front (orange bar) from any random angle (green bar)
Possible solutions I’m currently looking into
I’ve been looking into AlignOrientation, BodyGyro, the TELEPORT_FACE_ANGLE in the teleport script, and some trigonometry to see if this is even a triangle-based problem.
I might even be overthinking this entire problem.
I will be willing to post my pathfinding script since it would probably be edited to a pathfinding + tween script upon finding the solution to my current problem.
Potential future problem
Even if I get this solved,
I just need to figure out how to make this work for all instances of “Training Mat” but that’s for later.