void Start () { //Get Motor Components armHinge = GameObject.Find ("GoblinBossArm").GetComponent<HingeJoint2D>(); armMotor = armHinge.motor; //Set Motor Configs armMotor.motorSpeed = 45.0f; armMotor.maxMotorTorque = 20.0f; armHinge.motor = armMotor; //Set Sight Configs //Initialize sight ray sightRay1Start = sight1Start.position; sightRay1End = sight1End.position; sightRay2Start = sight2Start.position; sightRay2End = sight2End.position; //Debug //Debug.Log("Motor Speed Set: "+armHinge.motor.motorSpeed); //Invoke TiltBack Invoke ("TiltArmBack", 1.5f); InvokeRepeating("PlayAudio", 1.0f, 10.0f); //hits config _hits = GameObject.Find ("GoblinBossBody").GetComponent<GoblinBody>(); }
void Start () { //GetHits _hits = GameObject.Find("GoblinBossBody").GetComponent<GoblinBody>(); //Get Component headHinge = GameObject.Find ("GoblinBossHead").GetComponent<HingeJoint2D>(); headMotor = headHinge.motor; headMotor.motorSpeed = 5.0f; headMotor.maxMotorTorque = 20.0f; headHinge.motor = headMotor; Debug.Log("Motor Speed Set: "+headHinge.motor.motorSpeed); Invoke ("TiltHeadBack", 1.5f); }