- Home /
Question by
floppyturtle32 · Aug 14, 2020 at 03:51 AM ·
c#3dspringjoint
Springjoint not being added via script.
Hello, I have a springjoint that's being added to an object via code. This is the code that I have applied to a basic cube.
void Start()
{
//On start of program.
SpringJoint springJoint = GetComponent();
//Add the spring joint.
}
However, when I press play, a springjoint does not get added on the cube. Furthermore, there are no errors that show up. Is this code outdated (I use Unity 2018 ) or wrong? Is there any proper syntax for this?
Thanks for reading, any help will be tremendously appreciated.
Comment