Unity lockst the position of prefabs in my scene in playmode!

I have ceated aempty gameObject, that parents all objects in my scene (exept for the character) an by script, i wanted it move backwards, to create the ollusion of moving the charcter itself. But when i started the script, it only moved the ground, because that was the only object in my scene, that was no prefap. How can i fix this? Please help!

Maybe also insert the Code your using, so we can maybe help :o

OK! This is it.

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

public class move : MonoBehaviour
{
    public Transform Everything;
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        Everything.Translate(Vector3.forward * 5 * Time.deltaTime);
    }
}

Are your prefabs marked as static?

1 Like

Is “Everything” assigned? Are you seeing any console errors?

If you have an animation that drives the root object, that will also lock you in place. In that case, make a parent object and instantiate that instead.

Thanks for your answer! But how do I know that?

OK! It is so! Thank you!

1 Like