Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Trouble with error codes in unity 3d

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 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 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 post
Share on other sites

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

Tech News Posting Guidelines - READ BEFORE POSTING | Community Standards | Forum Staff

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

 

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

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

Docendo discimus - "the best way to learn is to teach" ~ Benjamin Jantz

 

I am a StarCitizen are you? My ships: Aegis Eclipse, Aegis Sabre, Aegis Gladius, Aopoa Nox, KI P52 Merlin, KI P72 Archimedes and the RSI Constellation Aquila.

 

My phones are a Samsung Note 9 and a Samsung S9+

 

🇺🇸   About Myself:   https://linustechtips.com/main/profile/229093-sansvarnic/?tab=field_core_pfield_46   🇺🇸

 

 CHRISTIAN MEMBER 

 

 

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
Newegg

×