- Home /
Get raw script of a Unity component
I am trying to make my own version of this component. Basically I was going to use this component, but then I realized that it didn't include all the features that I was hoping it had. So is there a way to somehow get the raw script Unity made for this component? And then I can copy that script and paste it in my own script and add on to it to add my features? Perhaps there is a place in the the unity files that I can find it?
This question kind of goes with any component. Like for the Character Controller Component, can I get the script from it and make my own version.
If it is impossible to get the script, can someone help me recreate this script? I have been having trouble recreating it.
Answer by AaronXRDev · Nov 10, 2018 at 06:00 AM
The source code to Unity is available on Github.
I think the specific thing you are looking for is the Rotation Constraint Editor.
Answer by Bunny83 · Nov 10, 2018 at 10:24 AM
No you can't get the source code for the build in components since most of them are implemented in native C++ code. The managed class is only an interface to the actual component on the native side. The RotationConstraint is not a MonoBehaviour derived component. It's derived from the internal Behaviour class. So we don't know how it's implemented. You can find the source of the managed wrapper class here.
Keep in mind that the source code in this github repository is for reference only. You are not allowed to copy and use it in a project. Please read the license carefully
As for recreating it, no, such requests do not belong here. I've never used this component so i don't know its complete feature set. This also may be more complicated than you thought. The component is designed to be versatile and easy to use. You haven't said what features you need. Most the time it's easier to develop a customized solution for your specific need.
Your answer
![](https://koobas.hobune.stream/wayback/20220612181844im_/https://answers.unity.com/themes/thub/images/avi.jpg)