Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Can't assign instantiated player to cinemachine

Discussion in '2D' started by Cool_stan, Oct 31, 2020.

  1. Cool_stan

    Cool_stan

    Joined:
    Oct 2, 2020
    Posts:
    2
    Hello, i'm new to unity and coding in general, i'm trying to make a 2d platformer but i'm stucked because of some issues.
    I can't assign my instantiated player prefab to camera or scripts in general, for example when the player touches an enemy he gets damage but the camera doesn't shake, the enemies don't attack him and the camera doesn't follow him... I'm sorry if i've been unclear, english is not my native language, if you need any script just ask, thank you!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Hello and sorry for the delayed response. If you make a scene and drag your prefab into the scene, you should then be able to assign that instance from the scene to your scripts. Have you tried that?
     
    Cool_stan likes this.
  3. Cool_stan

    Cool_stan

    Joined:
    Oct 2, 2020
    Posts:
    2
    Hello, thank you for the reply, by the way i already managed to do it by making the sripts find any gameobject tagged player instead of dragging it there from the hirerarchy.
     
    Gregoryl likes this.