• 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 /
This question was closed Dec 11, 2013 at 05:09 AM by Yung-Hustla for the following reason:

The question is answered, right answer was accepted

This post has been wikified, any user with enough reputation can edit it.
avatar image
2
Question by Yung-Hustla · Mar 07, 2011 at 11:23 PM · parentdisableenablevehicleenter

Vehicle Enter/Exit System for First/3rd Person :)

Hello People,

MY SCRIPT WILL BE AVAILABLE ON THE ASSET STORE FOR $15 VERY SOON!!

A GTA STYLE GAME WOULDNT B POSSIBLE WITHOUT IT!!!

WHAT IT CAN DO:

You can Simply run up to your car, press a key ("e" in my case) and enter your car. at this point your character is invisble and you can drive your car around while your invisible character gets steady moved with it. after pressing another key - (in my case "r") your character gets visible again and stands right besides your car. and you are now able to controll your character again while your car still stands where u left it. :)

Comment
Add comment · Show 9
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 Lewenos 1 · May 08, 2011 at 03:15 PM 0
Share

I have problem with that script.. I attached it into my car and filled right information.. Then i go to player, but when i run somewhere very far of my car and i click "e" in my case, player can drive car and when i click "r" (exit), player stands near car and car continues driving forward, then i click "e" (enter) again, and player can drive car.. So simply, my problem is that i have little box with trigger near my car, but when my player doesnt even hit that trigger, it can drive that car!

Please help me!

Thanks very much in advance! :)

avatar image Yung-Hustla · Aug 02, 2011 at 12:09 AM 0
Share

i made a video tutorial ill upload it tommorrow :)

avatar image Pilot · Oct 14, 2011 at 04:05 PM 0
Share

do you have a link to this video still??

avatar image Bunny83 · Dec 28, 2011 at 12:47 AM 2
Share

@ALL POSTERS:

Please, this is a Q&A site! Each "Question" have only one question at the top and the "Answers" should answer that question, nothing else. If you have further questions on a specific post use "add new comment". This site is not a forum to chit chat. I've cleaned up the answers and converted some of them to comments.

Also, please read the FAQs! This site is for clear and specific questions and for clear and specific answers. The accepted answer here on this question is not an answer!!!

If you like to chat with each other, visit the Unity Forums

avatar image Bunny83 · Dec 28, 2011 at 12:51 AM 1
Share

Ohh, and don't post the solution into the question! It's a total mess already. I don't have the time to disassemble this mess and reorder it. Please let the question be a question and post an answer if you have a solution. You can edit your posts at any time.

Show more comments

8 Replies

  • Sort: 
avatar image
0

Answer by ifirt456 · Oct 17, 2012 at 12:29 AM

Hey my script says Assets/_Scripts/EnterExit.js(24,71): BCE0019: 'enabled' is not a member of 'UnityEngine.Component'. please help since I am only a modeler :)

Comment
Add comment · Show 2 · 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 aftermathkid · Oct 28, 2012 at 03:25 PM 0
Share

I have the same error as iflirt456. Please help!

avatar image Jaspb97 · Dec 29, 2012 at 06:05 PM 0
Share

@ifirt456 open scipt and changes in the script to enable and then go in unity and edit> projectsetting> input then change the number in size 19 to 21 and then change the name of the last two with "e" and "r", put "and" in the alt button negative and also another sun that you put "r" in the negative alt button ... I hope you will both help ;)

avatar image
1

Answer by strongme · Dec 26, 2011 at 10:21 PM

I created a video tutorial for the script's implementation. I didn't tag the 'car' to vehicle, tag it according to 'Yung Hustla'. This script works really good, good work bro!

First Video: http://www.youtube.com/watch?v=TKDxRhkja0c

Second Video: http://www.youtube.com/watch?v=Cc-bvOSsc-c

Comment
Add comment · Show 3 · 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 Yung-Hustla · Dec 27, 2011 at 04:54 AM 0
Share

FIX*** You have to set is Player Visible" OFF in order to only enter the car if you hit the collider. That ist what the last two lines on the bottom on the script stand for.

avatar image shoodie786 · Jul 21, 2012 at 11:19 PM 0
Share

$$anonymous$$e don't even enter the car at all.

avatar image Yung-Hustla · Mar 31, 2013 at 11:27 PM 1
Share

check out the very easy to ndertand tutorial ive wrote for this in addition you can check out the youtube tuturial that "strongme" made for us :)

avatar image
2

Answer by by0log1c · Mar 08, 2011 at 12:19 AM

Here its me again with general answer. I won't code the whole thing, but try something along these lines and come back with your problems. If you don't need anything fancy, here's how you could order things:

  • Player enter Car trigger => Player learn of car existence
  • Player hit a key and a car is known => function enterCar
    • Play animation?
    • Destroy Player / Disable Renderer / Hide under terrain
    • Give control to car > Enable Script / Set a boolean variable
    • Move around
  • Player hit a key = > function exitCar
    • Take control off car
    • Play animation?
    • Instantiate Player back at the left of the car
    • Give control back to player

Can't believe I wrote all this, scripting would've been just as long but then I'd have done all the work ;)

Comment
Add comment · Show 3 · 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 Yung-Hustla · Mar 08, 2011 at 12:34 AM 1
Share

hey thx for this i got it now working halfways :) animations are not that important for now ill add them later as soon as i have created some XD ...

So my character is disabled and invisible on key hit (made use of your last answer to achieve this ) and parented to the trigger thats also parented to the car :)

but i cant figure out how to reverse the whole thing ... i mean unparent the character.

$$anonymous$$ay i show you my code im using now?

avatar image by0log1c · Mar 08, 2011 at 12:55 AM 0
Share

You can if there's something to look at :) . Otherwise, try someObject.transform.parent = null;

avatar image by0log1c · Mar 08, 2011 at 01:19 AM 0
Share

From this point, specific questions should be asked as such as this site is not for general programmation question or ordering scripts. Search Unify/Unity3DStudent/Unity Scripting Reference as much as you can, that's how we all learned, not so long ago.

  • ‹
  • 1
  • 2

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

22 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

Related Questions

Enable and disabled parent contraint with c# 1 Answer

how to disable patent components incode 0 Answers

How Do i Enable an Object and then Disable it? 1 Answer

enable / disable a script without dynamic typing 2 Answers

Rigidbody velocity limiter 0 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