So, I’m making a script so when a custom tool I made is in the workspace to lock the Y and Z axis, I tried a couple solutions but none worked so far, maybe anybody else knows how?
You can’t optimally lock those orientation values, however you can prevent them from changing. What exactly do you want to do and in what scenario?
When the tool was dropped (already having a system for it) prevent the tool from disappearing from the player’s view
the “Part” part is invisible so the player wont see the tool if it’s sideways
What do you mean by preventing it from dissapearing out of the player’s view? Do you possibly mean a Highlight?
That would ruin the aesthetic, being a 2D game
Then what else do you mean? Is it possible to show as a video a recreation of what you’d like to achieve?
The tool literally fell of the map (the grass part is CanColide = true)
How I want it to work:
Oh I see! Consider adding an invisible wall which prevents the tool from falling out of the map?
Maybe, but still if the player forgot where they left the tool at they might not find it, I could make a mini gui to show where it is but I would prefer for this game to be visible.
How do you plan on making the tool visible at all times? If the tool is out of screen bounds, then you can’t do much about it. You can teleport it close to the player if the player doesn’t see it, but I recommend on that pointy-UI.
I made barrier system for the camera and physical barriers, so nothing can get out of player reach, I will experiment with the UI pointer, but if you get any ideas on how to fix the rotation I would be more than glad to test it out.
If the part is unanchored, you can use a BodyGyro with its maxtorque set to Vector3 (0, math.huge, math.huge) to prevent it from rotating
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.