Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
setting player go.transform.position not changing position

Trying to move a player object to the start location built into each level of the game at level start but the object does not reposition. The player is not a child of another so I am working with root transform here.

//move player to start position (I know find is expensive)
startPosition_GO = GameObject.Find("StartPosition");
playerGO.transform.position = startPosition_GO.transform.position;

//and just to be because
playerGO.transform.position = new Vector3(startPosition_GO.transform.position.x, startPosition_GO.transform.position.y, startPosition_GO.transform.position.z);

player object stays where it was and does not move. enter image description here

including two images, first before starting the level you can see the starting location game object (the pink square). The code above is called at level start. The second image shows where the player (with the arrow nav icon on it sits after the code is executed. enter image description here

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Try just this code to move the player position.

startPosition_GO = GameObject.Find("StartPosition");
playerGO.transform.position = startPosition_GO.transform.position;
over 4 years ago · Santiago Trujillo Report

0

Set the position once. You could remove this

playerGO.transform.position = new Vector3(startPosition_GO.transform.position.x, startPosition_GO.transform.position.y, startPosition_GO.transform.position.z);

Or this and it should work.

playerGO.transform.position = startPosition_GO.transform.position;

The code seems redundant which could lead to issues.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!