Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

2d endless jumper camera.

Discussion in 'Scripting' started by EmilKihlberg, Nov 9, 2015.

  1. EmilKihlberg

    EmilKihlberg

    Joined:
    Oct 28, 2015
    Posts:
    11
    Hi folks, my issue is that my camera follows the character when it falls down, i just want it to follow the character in x axis and positive y axis can some1 help me please :)

    another problem i have is that my OnCollisionEnter for my platform falls is trigger when I'm jumping through my onewaycollider, i want it to the fall trigger to be activated when i land upon the collider please help ! xoxo
     
    Last edited: Nov 9, 2015
  2. RavenOfCode

    RavenOfCode

    Joined:
    Apr 5, 2015
    Posts:
    869
    Follows the camera? Are you parenting the camera to the player? I would suggest just using a separate camera follow script and move the camera just like the player.

    As far as your collider problem I would need to know more, maybe a script or something could help?
     
  3. EmilKihlberg

    EmilKihlberg

    Joined:
    Oct 28, 2015
    Posts:
    11

    I can provide script later, but so in update on this camers script, set transform.position.z = ?
    transform.position.x = ?
    transform.position.y = ?
    And as i said i can show you my trigger script when i get off work
     
  4. EmilKihlberg

    EmilKihlberg

    Joined:
    Oct 28, 2015
    Posts:
    11
     

    Attached Files:

  5. RavenOfCode

    RavenOfCode

    Joined:
    Apr 5, 2015
    Posts:
    869
    Im not sure how your game works exactly but I would use transform.translate to move the camera at the same speed as the player.
    I dont see anything wrong with your script so I would say to make sure the collision is actually happening, and that your player is tagged as player. Also is making you player not kinematic all you want to do when he dies?