Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by 5seaton4 · Apr 25, 2011 at 01:21 PM · teleportspawnpoint

trouble with teleportation script c#

Hello, i'm trying to make a teleportation script in unity with c# i have already made it so when they go through the teleport they end up at a different teleport with a sound i was wondering how i would make it so when you go through the teleport you end up just in front of the teleport not on it.

heres the code that teleport's me:

IEnumerator OnTriggerEnter(Collider other) {
    if(other.tag == ("teleport 1")) {
        audio.PlayOneShot(teleportSound);
        yield return new WaitForSeconds(0.8f);
        transform.position = SpawnPoint1.transform.position;
        yield return new WaitForSeconds(1.5f);

Any help will be appreciated.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by loopyllama · Apr 25, 2011 at 01:37 PM

float amount = 10.0F;
transform.position = SpawnPoint1.transform.position + SpawnPoint1.transform.forward * amount;

depending on the orientation of your SpawnPoint, you may have to throw a negative in there or do a .right instead of .forward

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image 5seaton4 · Apr 25, 2011 at 04:02 PM 0
Share

thankyou my fix was to deactivate the gameobject for a certain amount of time.

avatar image
-2

Answer by Trizza · Jan 12, 2012 at 07:06 AM

hey guys i need help 2 this is all i have for a teleport C# script please help me

using UnityEngine; using System.Collections;

public class teleport : MonoBehaviour {

 // Use this for initialization
 void Start () {
 
 }
 
 // Update is called once per frame
 void Update () {
 
 }

}

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image by0log1c · Jan 12, 2012 at 07:15 AM 2
Share

Bwahaha, nice wording, it almost doesn't look like you just pasted an empty $$anonymous$$onoBehaviour. I knew this one was going to come up sooner or later, but leaving the default comments in is unexpected, genius!

avatar image
0

Answer by Trizza · Jan 18, 2012 at 06:42 AM

yer its jst what comes up iv tried so many vids on youtube and copyed but it still neva works can you help me out

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Touch teleport script isnt working 2 Answers

Teleport the player from A to B 2 Answers

C# Instant Teleport Script 1 Answer

how to teleport a character 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges