Hello and sorry for the late reply due to website migration.
This is happening because of this line of code in your OnCreate method: toGameObject = null;
What is happening here is that you are setting the BBParameter field itself to null, instead of just it’s value, since the implicit operator in BBParameter can’t what of those two things you want to actually do.
Having said that, you dont really need to do what you are doing in OnCreate though 🙂
You can just declare the fields as normal, like for example:
1
2
3
4
5
6
7
8
9
10
11
publicBBParameter to=default(Vector3);
publicBBParameter toGameObject=null;
publicBBParameter setRelative=false;
publicBBParameter duration=0;
If you definetely need to do that OnCreate, you will need to make an explicit cast like this:
toGameObject = (GameObject)null;
But I really think that simply declaring the fields as eplxained above is better. (There is also no need of course at all if the values are the default ones like above.)
Let me know if that works for you.
Thanks
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.