0
\$\begingroup\$

i'm making a swimming mechanic for my game and i need to instantiate the swim camera under neath the fps player when it hist the water. no mater what I try the swim cam wont have the same y rotation as the fps when its instantiated, and vice versa. what am i doing wrong? here is the scriptInstantiate(swim, new Vector3(transform.position.x, transform.position.y -2, transform.position.z), rotation: transform.rotation=Quaternion.AngleAxis(0,0,0));

\$\endgroup\$
  • \$\begingroup\$ It could be because transform.rotation=Quaternion.AngleAxis(0,0,0) will assign a value to transform.rotation \$\endgroup\$ – Jay Feb 13 '19 at 2:55
  • \$\begingroup\$ i ment to add transform.rotation=Quaternion.AngleAxis(0,tTransform.rotation.y,0);sorry. it keeps throwing an error \$\endgroup\$ – Indiepixel Feb 13 '19 at 22:42
  • \$\begingroup\$ Why do you sometimes use transform and sometimes tTransform? \$\endgroup\$ – Jay Feb 14 '19 at 0:28
  • \$\begingroup\$ ah, just a mispelling, im a little jittery is all \$\endgroup\$ – Indiepixel Feb 14 '19 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.