Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 SlappyTheMonkeyBoy · Jan 27, 2019 at 07:23 PM · first-person-controllerteleporting

FPS teleport flicker one frame- but works fine with main camera.

I have a simple teleport script that works with my main camera. however when I switch to the prefab of the FPS. disable my main camera. change my game object in script from main camera to FPS controller. my player does not teleport. However I do see a flicker of the landing point each time I hit the trigger area.

It wants to teleport but something seems to be holding it back.

player.transform.position = landing1.transform.position;

Comment
Add comment · Show 1
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 DCordoba · Jan 27, 2019 at 11:25 PM 0
Share

humm, you dont have on the landing1 another collider who teleport it again to the first? maybe this just are doing a poing-pong between landing areas,

sorry, is very difficult get a clue with so lack of info...

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by bridget_cloud · Sep 10, 2019 at 06:25 PM

I had the same issue and disabled the FirstPersonController script before teleporting the FPS controller. I enabled it immediately after teleporting into the area and it seems to work fine (for now).

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
avatar image
0

Answer by unity_MUIlMppJ96RwuQ · Dec 05, 2019 at 09:58 AM

Hi, @bridget_cloud I have the same issue but I'm really new to unity and coding. Wouls you explain to me how you can disable FPS Controller script before teleporting? Like If you were talking to a 5 year old child... thanks a lot,Hi I'm new to unity and coding. I have the same issue, would you explain to me how I can disable the FPS script as you said? Thanks a lot

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 bridget_cloud · Dec 05, 2019 at 05:39 PM 0
Share

@unity_$$anonymous$$UIl$$anonymous$$ppJ96RwuQ Sure, but before I do I just wanted to mention that this doesn't seem to be an issue in version 2019.2.1. I'm able to transport the player by setting it's position to the spawn point position.

But here is what I did for version 2018:

**Note that I created a GameObject reference variable for the "player" and a Transform reference variable for the spawn point ("spawnPt") and then initialized them accordingly.

First I created a reference variable for the First Person Controller script:

 FirstPersonController fp;

Next, I initialized it in the Start method (of course I'm using a game object reference variable "player":

 fp = player.GetComponent<FirstPersonController>();

Then, in the Update method, I do my check to see if the user is trying to initiate the transport by pressing the E key (and also being near the door):

 if (Input.Get$$anonymous$$eyDown($$anonymous$$eyCode.E) && nearDoor){
 //code to transport player here
 }

$$anonymous$$y code to transport the player first disables the FPC script, moves the player, and then starts a coroutine to turn the script back on. (It also sets my bool variable that checks to see if they are able to move to false):

 nearDoor = false; //So the player won't keep moving back to the spawnPt with accidental key hits
 fp.enabled = false; //Disables FPC script
 player.transform.position = spawnPt.position; //Sets the players position to the same as the spawn point
 StartCoroutine(TurnOnScript(.25f)); 

Here is the code for TurnOnScript:

 private IEnumerator TurnOnScript(float time){
       yield return new WaitForSeconds(time);
       fp.enabled = true;
 }

Hope that helps. If you need any further clarification, let me know.

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

102 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

First Person Player Teleportation 10 Answers

moving is all messed up 1 Answer

Creating a character from a capsule 0 Answers

Insert First Person Controller, but can not move in Game view 3 Answers

Problem with logitech dual action gamepad 1 Answer


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