【发布时间】:2019-03-08 23:27:47
【问题描述】:
这是我的代码 Unity 说-“Unexpected Symbol {”
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Camera : MonoBehaviour {
//variables
public Transform player;
public float smooth = 0.3f;
private Vector3 velocity = Vector3.zero; //camera velocity to zero with variable velocity
//Methods
void Update()
{
Vector3 pos = new Vector3();
pos.x = player.position.x; // postion on x axis = player
pos.z = player.position.z - 7f; //-7f to move the camera a little back from player position
pos.y = player.position.y;
transform.position = Vector3.SmoothDamp{ transform.position, pos,ref velocity, smooth};
//smoothdamp is a function of vector 3 which smoothenes the movement
}
}
【问题讨论】:
-
欢迎来到 Stackoverflow。请阅读stackoverflow.com/help/how-to-ask
-
调用方法时使用括号:
transform.position = Vector3.SmoothDamp (transform.position, pos, ref velocity, smooth);
标签: c# visual-studio unity3d c#-3.0