- Home /
Pokemon Type Teleport not working. (transform.position)
I'm cloning pokemon for game development practise and im trying to make it so when your pokemon is health <= 0 then teleport to pokemon center but my transform.position isn't working. The character doesn't move at all, these scripts are placed on the player being a sprite with camera and a gameobject as a child.
RAW FILES: http://pastebin.com/8ZVsNBZn http://pastebin.com/kXLvcW5J
Where are you calling the TeleportToPC method?
Other thing, "this" makes no difference when you're getting UnityEngine variables, such as transform, gameObject, renderer, collider, etc.
I edited the code so you can see where I'm calling it from, thanks for trying to help :)
monsterEquipped.curHP - do you see "Your monster is dead" in debug.log?
yea, i do and i see TELEPORT and -12,9 which doesn't make sence to me why it doesn't teleport
Okay for some reason it randomly teleported.. D: but wont do it again ???
Answer by Mikael-Gyth · Apr 12, 2014 at 07:11 AM
"with camera and a gameobject as a child"
You don't happen to be moving the camera as well as the pokemon, and because of that, even if the location has moved it looks like it hasn't because the camera is relative to the object?
the script is played on the parent and I've watched the scene screen and nothing moves at all. It teleports sometimes and others is just comes up with the debug.log but doesn't actually teleport i dont get it :.
Your answer
Follow this Question
Related Questions
How do I make an object teleport 2 Answers
Distribute terrain in zones 3 Answers
Making The Hole In A Golf Game 1 Answer
how to make a bolt collision teleport player to where the collision happened 1 Answer
Multiple Cars not working 1 Answer