Advertisement

advance enemy

Started by April 19, 2017 01:16 PM
2 comments, last by Lactose 7 years, 8 months ago

I am playing Unity 2D, I wrote the following code to advance the enemy, but when I play the game the enemy does not advance or even disappears


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

public class Dusman : MonoBehaviour {
    public Transform hedef;
	void Start () {
        hedef = GameObject.FindGameObjectWithTag("Player").transform;
	}
	void FUpdate() {
        
        transform.LookAt(hedef);
        transform.position += transform.forward * 2 * Time.deltaTime;
        
    }
}

Shouldn't that be "FixedUpdate()" instead of "FUpdate()"?

Hello to all my stalkers.

Advertisement

Shouldn't that be "FixedUpdate()" instead of "FUpdate()"?

I did that later on Update () but it does not work

Shouldn't that be "FixedUpdate()" instead of "FUpdate()"?

I did that later on Update () but it does not work

So you are saying that the code you posted is not your actual code that's running?

Hello to all my stalkers.

This topic is closed to new replies.

Advertisement