Hi,

I get an error message, which i do not really understand. Screenshots here:

“Cannon” is a Transform.

Can Someone help me with this?

Thank you,

Zerzuskan

Hi,

I get an error message, which i do not really understand. Screenshots here:

“Cannon” is a Transform.

Can Someone help me with this?

Thank you,

Zerzuskan

Cannon.rotation does not exist as euler angles, but cannon.*transform*.rotation does, but I think that Cannon.transform.rotation.eulerAngles is readonly (Meaning that it cannot be changed), so if that does not work, use Cannon.transform.eulerAngles. Because the rotation transform is stored as a quaternion, the code gets the quaternion and converts it into euler angles, so it is trying to return the new euler angles, while you are trying to give it euler angles, so it returns an error. Sorry if this is difficult to understand, it is kind of hard to explain, just use Cannon.transform.eulerAngles in place of Cannon.transform.rotation.eulerAngles.

cannon is a transform variable, so this should not be the problem(you cant see ist in the screenshot, so i wrote it in the question).

The second part:

So because rotation works as quaternion i cant use rotation.eulerangles to store an new rotstion as Euler angles? Like rotation.eulerangles is readonly? Can i convert the Vektor3 to an Quaternion somehow?