質問編集履歴
6
えい
test
CHANGED
File without changes
|
test
CHANGED
@@ -408,6 +408,24 @@
|
|
408
408
|
|
409
409
|
### 追記
|
410
410
|
|
411
|
+
**今のままのやり方**
|
412
|
+
|
411
413
|
分かりにくいですが、今の状態だと桃に近づくほど揺れが大きくなります。
|
412
414
|
|
413
415
|
![イメージ説明](11fd9e4b73ae48cea52f43fc19f4b04b.png)
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
**animationcurveのやり方**
|
420
|
+
|
421
|
+
これでも中心に座標が行ってしまいます。
|
422
|
+
|
423
|
+
```C#
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
Vector3 pos = transform.localPosition;
|
428
|
+
|
429
|
+
transform.position = new Vector3(curve.Evaluate(pos.x + Time.time),pos.y + 0,pos.z + 0);
|
430
|
+
|
431
|
+
```
|
5
era-
test
CHANGED
File without changes
|
test
CHANGED
@@ -401,3 +401,13 @@
|
|
401
401
|
transform.localPosition = new Vector3(pos.x + 0, pos.y + sin, 0);
|
402
402
|
|
403
403
|
```
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
### 追記
|
410
|
+
|
411
|
+
分かりにくいですが、今の状態だと桃に近づくほど揺れが大きくなります。
|
412
|
+
|
413
|
+
![イメージ説明](11fd9e4b73ae48cea52f43fc19f4b04b.png)
|
4
えい
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,6 +16,366 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
RandomMove
|
24
|
+
|
25
|
+
```C#
|
26
|
+
|
27
|
+
using System.Collections;
|
28
|
+
|
29
|
+
using System.Collections.Generic;
|
30
|
+
|
31
|
+
using UnityEngine;
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
public class RandomMove : MonoBehaviour
|
36
|
+
|
37
|
+
{
|
38
|
+
|
39
|
+
protected IEnumerator NowAct;
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
#region 定数
|
44
|
+
|
45
|
+
protected const float FIELD_OF_VIEW_MAX = 60; // 視野範囲
|
46
|
+
|
47
|
+
protected const float DEG_ROT_MAX = 1; // 角度の許容値
|
48
|
+
|
49
|
+
protected const float ROTSPEED = 0.5f; // 回転速度
|
50
|
+
|
51
|
+
#endregion
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
/// <summary>
|
58
|
+
|
59
|
+
/// 非捕捉状態のときの挙動
|
60
|
+
|
61
|
+
/// </summary>
|
62
|
+
|
63
|
+
protected IEnumerator Nolock_Action() {
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
var now_Z = transform.localRotation.eulerAngles.z;//現在角度.z
|
68
|
+
|
69
|
+
var new_Z = now_Z + Random.Range(60f, -60f);//目標角度.z
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
float rotspeed = 3;//回転速度
|
74
|
+
|
75
|
+
float f = 0; //回転進行度
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
while (f <= 1) {
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
f += Time.deltaTime * rotspeed;
|
84
|
+
|
85
|
+
gameObject.transform.rotation = Quaternion.Euler(0, 0, Mathf.LerpAngle(now_Z, new_Z, f));
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
yield return null;
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
float speed;// 移動スピード
|
96
|
+
|
97
|
+
float speed_Max = 4f;
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
float time = 0;//移動時間
|
102
|
+
|
103
|
+
float time_Max = 3;
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
uint move_sens = 0x00000001;
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
speed = Random.Range(0, speed_Max);
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
while (time < time_Max) {
|
116
|
+
|
117
|
+
var delta = Time.deltaTime;
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
time += delta;
|
122
|
+
|
123
|
+
var puls = (speed * delta) * move_sens;
|
124
|
+
|
125
|
+
transform.Translate(0, puls, 0);
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
yield return null;
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
NowAct = null;
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
/// <summary>
|
140
|
+
|
141
|
+
/// 移動
|
142
|
+
|
143
|
+
/// </summary>
|
144
|
+
|
145
|
+
protected virtual void Follow() { }
|
146
|
+
|
147
|
+
}
|
148
|
+
|
149
|
+
```
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
Enemy_Limp_Move
|
156
|
+
|
157
|
+
```C#
|
158
|
+
|
159
|
+
using System.Collections;
|
160
|
+
|
161
|
+
using System.Collections.Generic;
|
162
|
+
|
163
|
+
using UnityEngine;
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
public class Enemy_Limp_Move : RandomMove
|
168
|
+
|
169
|
+
{
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
[SerializeField] Enemy_Status enemy; // ステータス
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
float angleValue = 0; //回転進行度
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
void Update()
|
182
|
+
|
183
|
+
{
|
184
|
+
|
185
|
+
var en_up = transform.up;
|
186
|
+
|
187
|
+
var en_to_pl = (Player.player.transform.position - transform.position);
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
var deg = Vector3.SignedAngle(en_up, en_to_pl, Vector3.forward);
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
if (Mathf.Abs(deg) <= FIELD_OF_VIEW_MAX) {// 視界内(±FIELD_OF_VIEW_MAX)か?
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
//視界内→追従開始
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
if (NowAct != null) {//NowActの中がnullでない場合、非追従処理が走っている可能性が高い。→非追従処理を止めて、破棄。
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
StopCoroutine(NowAct);
|
208
|
+
|
209
|
+
NowAct = null;
|
210
|
+
|
211
|
+
}
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
Player_Of_Rotate(deg);
|
216
|
+
|
217
|
+
//Player_Of_Limp_Follow();
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
Follow();
|
222
|
+
|
223
|
+
}
|
224
|
+
|
225
|
+
else {
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
//視界外→ランダム移動開始
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
if (NowAct == null) {// ランダムに回転・移動
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
NowAct = Nolock_Action();
|
238
|
+
|
239
|
+
StartCoroutine(NowAct);
|
240
|
+
|
241
|
+
}
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
}
|
246
|
+
|
247
|
+
/// <summary>
|
248
|
+
|
249
|
+
/// プレイヤーの方向に回転し追従
|
250
|
+
|
251
|
+
/// </summary>
|
252
|
+
|
253
|
+
void Player_Of_Rotate(float deg)
|
254
|
+
|
255
|
+
{
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
if (Mathf.Abs(deg) >= DEG_ROT_MAX) {//角度修正
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
var now_Z = transform.localRotation.eulerAngles.z; //現在角度.z
|
264
|
+
|
265
|
+
var new_Z = now_Z + deg; //目標角度.z
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
if (angleValue <= 1) {// 目標角度に回転
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
angleValue += Time.deltaTime * ROTSPEED;
|
274
|
+
|
275
|
+
gameObject.transform.rotation = Quaternion.Euler(0, 0, Mathf.LerpAngle(now_Z, new_Z, angleValue));
|
276
|
+
|
277
|
+
}
|
278
|
+
|
279
|
+
else {
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
angleValue = 0;
|
284
|
+
|
285
|
+
}
|
286
|
+
|
287
|
+
}
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
// プレイヤーの方向に前進
|
292
|
+
|
293
|
+
transform.position += (Player.player.transform.position - transform.position).normalized * enemy.enemy_Speed * Time.deltaTime;
|
294
|
+
|
295
|
+
}
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
/// <summary>
|
302
|
+
|
303
|
+
/// ぐにゃぐにゃ追従
|
304
|
+
|
305
|
+
/// </summary>
|
306
|
+
|
307
|
+
protected override void Follow() {
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
//float T = 1.0f;
|
312
|
+
|
313
|
+
//float f = 1.0f / T;
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
//var pos = transform.localPosition;
|
318
|
+
|
319
|
+
//pos.x = Mathf.Sin(2 * Mathf.PI * f * Time.deltaTime);
|
320
|
+
|
321
|
+
////pos += (Player.player.transform.localPosition - transform.localPosition).normalized * enemy.enemy_Speed * Time.deltaTime;
|
322
|
+
|
323
|
+
//transform.localPosition = pos;
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
Vector3 pos = transform.position;
|
328
|
+
|
329
|
+
float sin = Mathf.Sin(Time.time)/2;
|
330
|
+
|
331
|
+
transform.localPosition = new Vector3(pos.x + 0, pos.y + sin, 0);
|
332
|
+
|
333
|
+
}
|
334
|
+
|
335
|
+
}
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
```
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
ステータス
|
344
|
+
|
345
|
+
```C#
|
346
|
+
|
347
|
+
using System;
|
348
|
+
|
349
|
+
using System.Collections;
|
350
|
+
|
351
|
+
using System.Collections.Generic;
|
352
|
+
|
353
|
+
using UnityEngine;
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
[CreateAssetMenu(fileName = "Enemy", menuName = "ScriptableObjects/CreateAsset")]
|
358
|
+
|
359
|
+
public class Enemy_Status : ScriptableObject
|
360
|
+
|
361
|
+
{
|
362
|
+
|
363
|
+
public float enemy_Speed = 0.1f;// スピード
|
364
|
+
|
365
|
+
}
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
```
|
370
|
+
|
371
|
+
### 今困っている事
|
372
|
+
|
373
|
+
自身の位置で横移動しない→ローカルで動かしたい。
|
374
|
+
|
375
|
+
揺れが大きい
|
376
|
+
|
377
|
+
|
378
|
+
|
19
379
|
やったこと
|
20
380
|
|
21
381
|
向きは勝手に変わるのでsinでそうゆう風な動きが出来ないかと思いやってみました。
|
@@ -24,378 +384,20 @@
|
|
24
384
|
|
25
385
|
|
26
386
|
|
27
|
-
|
387
|
+
この部分でSinを使ってやろうとしました。が
|
388
|
+
|
28
|
-
|
389
|
+
揺れが大きい→割る2してみたが揺れはそのまま
|
390
|
+
|
29
|
-
|
391
|
+
ローカルで移動したい→transform.localPosition に代入しているのにできない。
|
30
|
-
|
392
|
+
|
31
|
-
|
393
|
+
回答お願いします。
|
32
394
|
|
33
395
|
```C#
|
34
396
|
|
35
|
-
using System.Collections;
|
36
|
-
|
37
|
-
using System.Collections.Generic;
|
38
|
-
|
39
|
-
using UnityEngine;
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
public class RandomMove : MonoBehaviour
|
44
|
-
|
45
|
-
{
|
46
|
-
|
47
|
-
protected IEnumerator NowAct;
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
#region 定数
|
52
|
-
|
53
|
-
protected const float FIELD_OF_VIEW_MAX = 60; // 視野範囲
|
54
|
-
|
55
|
-
protected const float DEG_ROT_MAX = 1; // 角度の許容値
|
56
|
-
|
57
|
-
protected const float ROTSPEED = 0.5f; // 回転速度
|
58
|
-
|
59
|
-
#endregion
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
/// <summary>
|
66
|
-
|
67
|
-
/// 非捕捉状態のときの挙動
|
68
|
-
|
69
|
-
/// </summary>
|
70
|
-
|
71
|
-
|
397
|
+
Vector3 pos = transform.position;
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
398
|
+
|
76
|
-
|
77
|
-
var new_Z = now_Z + Random.Range(60f, -60f);//目標角度.z
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
float rotspeed = 3;//回転速度
|
82
|
-
|
83
|
-
float
|
399
|
+
float sin = Mathf.Sin(Time.time)/2;
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
400
|
+
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
f += Time.deltaTime * rotspeed;
|
92
|
-
|
93
|
-
|
401
|
+
transform.localPosition = new Vector3(pos.x + 0, pos.y + sin, 0);
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
yield return null;
|
98
|
-
|
99
|
-
}
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
float speed;// 移動スピード
|
104
|
-
|
105
|
-
float speed_Max = 4f;
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
float time = 0;//移動時間
|
110
|
-
|
111
|
-
float time_Max = 3;
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
uint move_sens = 0x00000001;
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
speed = Random.Range(0, speed_Max);
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
while (time < time_Max) {
|
124
|
-
|
125
|
-
var delta = Time.deltaTime;
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
time += delta;
|
130
|
-
|
131
|
-
var puls = (speed * delta) * move_sens;
|
132
|
-
|
133
|
-
transform.Translate(0, puls, 0);
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
yield return null;
|
138
|
-
|
139
|
-
}
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
NowAct = null;
|
144
|
-
|
145
|
-
}
|
146
|
-
|
147
|
-
/// <summary>
|
148
|
-
|
149
|
-
/// 移動
|
150
|
-
|
151
|
-
/// </summary>
|
152
|
-
|
153
|
-
protected virtual void Follow() { }
|
154
|
-
|
155
|
-
}
|
156
402
|
|
157
403
|
```
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
Enemy_Limp_Move
|
164
|
-
|
165
|
-
```C#
|
166
|
-
|
167
|
-
using System.Collections;
|
168
|
-
|
169
|
-
using System.Collections.Generic;
|
170
|
-
|
171
|
-
using UnityEngine;
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
public class Enemy_Limp_Move : RandomMove
|
176
|
-
|
177
|
-
{
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
[SerializeField] Enemy_Status enemy; // ステータス
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
float angleValue = 0; //回転進行度
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
void Update()
|
190
|
-
|
191
|
-
{
|
192
|
-
|
193
|
-
var en_up = transform.up;
|
194
|
-
|
195
|
-
var en_to_pl = (Player.player.transform.position - transform.position);
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
var deg = Vector3.SignedAngle(en_up, en_to_pl, Vector3.forward);
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
if (Mathf.Abs(deg) <= FIELD_OF_VIEW_MAX) {// 視界内(±FIELD_OF_VIEW_MAX)か?
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
//視界内→追従開始
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
if (NowAct != null) {//NowActの中がnullでない場合、非追従処理が走っている可能性が高い。→非追従処理を止めて、破棄。
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
StopCoroutine(NowAct);
|
216
|
-
|
217
|
-
NowAct = null;
|
218
|
-
|
219
|
-
}
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
Player_Of_Rotate(deg);
|
224
|
-
|
225
|
-
//Player_Of_Limp_Follow();
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
Follow();
|
230
|
-
|
231
|
-
}
|
232
|
-
|
233
|
-
else {
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
//視界外→ランダム移動開始
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
if (NowAct == null) {// ランダムに回転・移動
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
NowAct = Nolock_Action();
|
246
|
-
|
247
|
-
StartCoroutine(NowAct);
|
248
|
-
|
249
|
-
}
|
250
|
-
|
251
|
-
}
|
252
|
-
|
253
|
-
}
|
254
|
-
|
255
|
-
/// <summary>
|
256
|
-
|
257
|
-
/// プレイヤーの方向に回転し追従
|
258
|
-
|
259
|
-
/// </summary>
|
260
|
-
|
261
|
-
void Player_Of_Rotate(float deg)
|
262
|
-
|
263
|
-
{
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
if (Mathf.Abs(deg) >= DEG_ROT_MAX) {//角度修正
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
var now_Z = transform.localRotation.eulerAngles.z; //現在角度.z
|
272
|
-
|
273
|
-
var new_Z = now_Z + deg; //目標角度.z
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
if (angleValue <= 1) {// 目標角度に回転
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
angleValue += Time.deltaTime * ROTSPEED;
|
282
|
-
|
283
|
-
gameObject.transform.rotation = Quaternion.Euler(0, 0, Mathf.LerpAngle(now_Z, new_Z, angleValue));
|
284
|
-
|
285
|
-
}
|
286
|
-
|
287
|
-
else {
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
angleValue = 0;
|
292
|
-
|
293
|
-
}
|
294
|
-
|
295
|
-
}
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
// プレイヤーの方向に前進
|
300
|
-
|
301
|
-
transform.position += (Player.player.transform.position - transform.position).normalized * enemy.enemy_Speed * Time.deltaTime;
|
302
|
-
|
303
|
-
}
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
/// <summary>
|
310
|
-
|
311
|
-
/// ぐにゃぐにゃ追従
|
312
|
-
|
313
|
-
/// </summary>
|
314
|
-
|
315
|
-
protected override void Follow() {
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
//float T = 1.0f;
|
320
|
-
|
321
|
-
//float f = 1.0f / T;
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
//var pos = transform.localPosition;
|
326
|
-
|
327
|
-
//pos.x = Mathf.Sin(2 * Mathf.PI * f * Time.deltaTime);
|
328
|
-
|
329
|
-
////pos += (Player.player.transform.localPosition - transform.localPosition).normalized * enemy.enemy_Speed * Time.deltaTime;
|
330
|
-
|
331
|
-
//transform.localPosition = pos;
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
Vector3 pos = transform.position;
|
336
|
-
|
337
|
-
float sin = Mathf.Sin(Time.time)/2;
|
338
|
-
|
339
|
-
transform.localPosition = new Vector3(pos.x + 0, pos.y + sin, 0);
|
340
|
-
|
341
|
-
}
|
342
|
-
|
343
|
-
}
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
```
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
ステータス
|
352
|
-
|
353
|
-
```C#
|
354
|
-
|
355
|
-
using System;
|
356
|
-
|
357
|
-
using System.Collections;
|
358
|
-
|
359
|
-
using System.Collections.Generic;
|
360
|
-
|
361
|
-
using UnityEngine;
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
[CreateAssetMenu(fileName = "Enemy", menuName = "ScriptableObjects/CreateAsset")]
|
366
|
-
|
367
|
-
public class Enemy_Status : ScriptableObject
|
368
|
-
|
369
|
-
{
|
370
|
-
|
371
|
-
public float enemy_Speed = 0.1f;// スピード
|
372
|
-
|
373
|
-
}
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
```
|
378
|
-
|
379
|
-
### 今困っている事
|
380
|
-
|
381
|
-
自身の位置で横移動しない→ローカルで動かしたい。
|
382
|
-
|
383
|
-
揺れが大きい
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
### 追記
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
```C#
|
394
|
-
|
395
|
-
Vector3 pos = transform.position;
|
396
|
-
|
397
|
-
float sin = Mathf.Sin(Time.time)/2;
|
398
|
-
|
399
|
-
transform.localPosition = new Vector3(pos.x + 0, pos.y + sin, 0);
|
400
|
-
|
401
|
-
```
|
3
せいや
test
CHANGED
File without changes
|
test
CHANGED
@@ -381,3 +381,21 @@
|
|
381
381
|
自身の位置で横移動しない→ローカルで動かしたい。
|
382
382
|
|
383
383
|
揺れが大きい
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
### 追記
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
```C#
|
394
|
+
|
395
|
+
Vector3 pos = transform.position;
|
396
|
+
|
397
|
+
float sin = Mathf.Sin(Time.time)/2;
|
398
|
+
|
399
|
+
transform.localPosition = new Vector3(pos.x + 0, pos.y + sin, 0);
|
400
|
+
|
401
|
+
```
|
2
era-NullReferenceException: Object reference not set to an instance of an object PlayerMove.Update (
test
CHANGED
File without changes
|
test
CHANGED
@@ -378,4 +378,6 @@
|
|
378
378
|
|
379
379
|
### 今困っている事
|
380
380
|
|
381
|
-
自身の位置で横移動しない
|
381
|
+
自身の位置で横移動しない→ローカルで動かしたい。
|
382
|
+
|
383
|
+
揺れが大きい
|
1
せいや
test
CHANGED
File without changes
|
test
CHANGED
@@ -375,3 +375,7 @@
|
|
375
375
|
|
376
376
|
|
377
377
|
```
|
378
|
+
|
379
|
+
### 今困っている事
|
380
|
+
|
381
|
+
自身の位置で横移動しない
|