i want to teleport my player (objToTP) to a another object (tplocation), i currently have this:
objToTP.transform.position = tplocation.transform.position ;
but it doesn,t work, variables are assigned and the function executes, no error message in the console,ok, so i want to tp my player when he touches a trigger, i currently have this:
objToTP.transform.position = tplocation.transform.position ;
both are assigned but nothing works, the function is executing (checked that with debug.log)
anyone knows what
Try Debug.Log(objToTP.name); to make sure your moving the object you think… maybe also try Debug.Log(tplocation.transform.position.ToString()); to make sure your location is what you think it is…
Other than that your code seems sound to me.
@ray2yar ok, thx, the objToTP should be fine, cause i already tried debug.log(objToTP.transform.position) to make sure that it was getting that right and it did indeed output the position of my player, i’ll try doing what you say, but i think it’s unlikely to be an issue with the location of the tplocation as the player doesn’t teleport at all