【问题标题】:Asking for body variable in unity统一要求身体变量
【发布时间】:2020-09-19 16:59:52
【问题描述】:

我正在尝试统一制作一个跳转脚本,但我总是收到此错误

Assets\JumpScript.cs(8,6): error CS0501: 'JumpScript.Start()' must declare a body because it is not marked abstract, extern, or partial

这是我的代码:

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

public class JumpScript : MonoBehaviour
{
void Start();

    void Update() {
        if (Input.GetKeyDown (KeyCode.Space)) {
            GetComponent<RigidBody> ().AddForce (Vector3.up *1000);
        }
    }
}

【问题讨论】:

标签: c# unity3d


【解决方案1】:

简单的改变

void Start();

void Start()
{

}

【讨论】:

    猜你喜欢
    • 2016-09-07
    • 1970-01-01
    • 2017-03-04
    • 2011-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多