Author Topic: NGUI Button Teleport Player  (Read 3245 times)

jessekirbs

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
NGUI Button Teleport Player
« on: June 17, 2014, 05:58:41 PM »
Looked around and couldn't find an answer to this... How can I make an NGUI button teleport the player to a new location? Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Button Teleport Player
« Reply #1 on: June 18, 2014, 05:00:35 PM »
  1. void OnClick()
  2. {
  3.     Debug.Log("Teleport me");
  4. }

jessekirbs

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: NGUI Button Teleport Player
« Reply #2 on: June 25, 2014, 12:20:02 PM »
Sorry... I'm confused. Wouldn't this require a "transform.position" line?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Button Teleport Player
« Reply #3 on: June 26, 2014, 09:48:30 AM »
Sure, if you want it to teleport to a specific location. The code I pasted shows how to respond to a click. What you do with it is up to you. Beyond this it's not an NGUI question.

jessekirbs

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: NGUI Button Teleport Player
« Reply #4 on: July 11, 2014, 01:48:45 PM »
Got it. Thanks.