Jump to content

Trouble with error codes in unity 3d

Jackb

Hello i am a beginner and i am not very good at coding but i am making a 3rd person shooter and i am making the 3rd person script it says a ; is expected on line 15 and a , is also expected but where (both on line 15 heres my script


 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameCamera : MonoBehaviour
{

    [SerializeField] private GameObject Target;
    [SerializeField] private Vector3 TranslationOffset;
    [SerializeField] private Vector3 followOffset;

    private void FixedUpdate()
    {
        float yrotation = Target.transform.eulerAngles.y;
        Quaternion rotation.Euler(0, yAngle, 0);

        transform.position = Target.transform.position - (rotation* followOffset);
        transform.LookAt(Target.transform.position + TranslationOffset);
    }
}

 

Edited by LogicalDrm
Link to comment
Share on other sites

Link to post
Share on other sites

On line 15 you are setting the rotation variable it should read like so

Quaternion rotation = Quaternion.Euler(0, yAngle, 0);

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, C2dan88 said:

On line 15 you are setting the rotation variable it should read like so


Quaternion rotation = Quaternion.Euler(0, yAngle, 0);

 

Thank you

Link to comment
Share on other sites

Link to post
Share on other sites

@Jackb please add code tags or your topic could be removed for not following posting requirements.

COMMUNITY STANDARDS   |   TECH NEWS POSTING GUIDELINES   |   FORUM STAFF

LTT Folding Users Tips, Tricks and FAQ   |   F@H & BOINC Badge Request   |   F@H Contribution    My Rig   |   Project Steamroller

I am a Moderator, but I am fallible. Discuss or debate with me as you will but please do not argue with me as that will get us nowhere.

 

Spoiler

  

 

Character is like a Tree and Reputation like its Shadow. The Shadow is what we think of it; The Tree is the Real thing.  ~ Abraham Lincoln

Reputation is a Lifetime to create but seconds to destroy.

You have enemies? Good. That means you've stood up for something, sometime in your life.  ~ Winston Churchill

Docendo discimus - "to teach is to learn"

 

 CHRISTIAN MEMBER 

 

 
 
 
 
 
 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×