Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
how to teleport to another player with ID
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
john Lotte
7y
234
1
Reply
Im using unity3D pls help me,,,How to fix this code? this code work can teleport to player but not targeting player/random player,I want to teleport to another player with iD like , ./tp 1 so will teleport to player with ID 1,,,, here is my code
if
(
this
.inputLine.StartsWith(
"/tp"
))
{
foreach
(GameObject obj22
in
GameObject.FindGameObjectsWithTag(
"Player"
))
{
PhotonPlayer player18 = PhotonPlayer.Find(Convert.ToInt32(
this
.inputLine.Remove(0, 5)));
objArray25 = GameObject.FindGameObjectsWithTag(
"Player"
);
for
(num59 = 0; num59 < objArray25.Length; num59++)
{
GameObject obj7 = objArray25[num59];
if
(obj22.GetComponent<HERO>().photonView.isMine)
{
obj22.GetComponent<HERO>().transform.position = obj7.GetComponent<HERO>().transform.position;
}
}
}
}
pleasw help
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
How to mask a phone number in MVC?
extract date part only from a English sentence