Partage
  • Partager sur Facebook
  • Partager sur Twitter

Position unity

    3 mars 2019 à 20:55:12

    Bonjour,

    Je suis en train de créer un jeu d’arcade sous Unity en 2D.

    Je fais spawn  une plateforme, et j'aimerais en place d'autre a la suite, malhuresement je trouve comme prendre la position de la "fin" de la plateforme.

    Pouvez-vous m'aidez ?

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class Spawn_PF : MonoBehaviour
    {
        public  GameObject pf1;
        public  GameObject pf2;
        private Vector2 position2D;
        private Quaternion rotation2D;
        private bool intialisionPF1 = true;
    
        // Start is called before the first frame update
        void Start()
        {
            position2D = new Vector2(-10, 0);
            rotation2D = new Quaternion(0f, 0f, 0f, 0f);
        }
    
        // Update is called once per frame
        void Update()
        {
            if(intialisionPF1)
            {
                Instantiate(pf1, position2D, rotation2D);
                intialisionPF1 = false;
            }
        }
    }
    • Partager sur Facebook
    • Partager sur Twitter

    Position unity

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown