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 Astec Studio · Nov 11, 2014 at 09:31 PM ·

Help My TP.js Script isn't working

i have no errors but it wont work please help! I add a Partical system as my TP's an then inserted abox collider which i set the trigger to true, now why is it when i play the box collider isn't working like it should, it should work like an invisble door that takeyou to pointb, I parented the TP's to one another but the portles act a a barrior instead of a portal

 #pragma strict
 var target : GameObject;
 var adjust : float;
 var c1 : Color;
 var jump : boolean;
 
 function Start (){
     renderer.material.color = c1;
 }
 
 function OnTriggerEnter(other : Collider){
     if(!jump){
         if(other.tag == "Player"){
             target.GetComponent(Teleport).jump = true;
              other.gameObject.transform.position = Vector3(target.transform.position.x, target.transform.position.y + adjust, 0);            
         }    
     }
 }
 function OnTriggerExit(other : Collider){
     if(other.tag == "Player"){
         jump = false;
     }
 }
 

Comment
Add comment · Show 26
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 MrSoad · Nov 11, 2014 at 08:48 PM 0
Share

Hi, you need to say why it is not working, what it is not doing that you want it to do :)

avatar image Astec Studio · Nov 11, 2014 at 08:51 PM 0
Share

I add a box collideraround my partical system aka my TP and i set trigger to true and i add the script to both TP's but it wont let my character go through.

avatar image Astec Studio · Nov 11, 2014 at 08:58 PM 0
Share

It's so odd to me but the trigger wont work do u think if I add a 2d colliderwill it work?

avatar image MrSoad · Nov 11, 2014 at 09:01 PM 0
Share

What do you mean when you say it won't let the character go through, do you mean it acts like a collider rather than a trigger?

avatar image Astec Studio · Nov 11, 2014 at 09:10 PM 0
Share

yes exactly thats it

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by spiceboy9994 · Nov 11, 2014 at 11:44 PM

Here's something to test your script:

Try commenting the line 15 (stop moving the other game object), instead of that, just place a Debug.Log to ensure that the line is hit. It may be entering the trigger, but the transform relocation could be the line that provokes the strange behavior. Also, place a debug.log to ensure that jump variable is false. It is not really an answer, but it could help you out on finding what the real issue is.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

I set wordpad to open my scripting files by accident and want to open it with monodevelop? Bu I don't know how? 1 Answer

Moving Platform Help (c#) 3 Answers

Roll-A-Ball tutorial help. 0 Answers

calling functions help {javascript} 1 Answer

Scripting BUG: target becomes bigger when getting nearer 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