音ゲーのノーツが流れる部分を作ろうとして、下のようなスクリプトを書いたのですが、
C#
1コード 2using System.Collections; 3using System.Collections.Generic; 4using UnityEngine; 5 6public class notes : MonoBehaviour 7{ 8 public int y; 9 public int x; 10 // Start is called before the first frame update 11 void Start() 12 { 13 14 } 15 16 // Update is called once per frame 17 void Update() 18 { 19 transform.position.x += x; 20 transform.position.y += y; 21 } 22} 23
Assets\script\notes.cs(19,9): error CS1612: Cannot modify the return value of 'Transform.position' because it is not a variable
というエラーが出てしまいます!!
ちなみに作ろうとしてる音ゲーは
4レーンの十字型で真ん中に向かってノーツが流れていく...というものです。
HELP!!ME!!
リファレンスを確認してみては。
回答2件
あなたの回答
tips
プレビュー