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 pixelboi · Dec 09, 2010 at 05:20 AM · raycastfpsiphonebce0019unityiphone

Why does this script I got from the Unity Document site does not work?

I got the error: "Assets/Scripts/_pistolAI.js(7,47): BCE0019: 'GetTouch' is not a member of 'UnityEngine.Input'. Did you mean 'GetKey' ?"

http://unity3d.com/support/documentation/ScriptReference/Input.GetTouch.html

// Shoot a ray whenever the user taps on the screen
var particle : GameObject;
function Update () {
for (var i = 0; i < Input.touchCount; ++i) {
if (Input.GetTouch(i).phase == TouchPhase.Began) {
// Construct a ray from the current touch coordinates
var ray = Camera.main.ScreenPointToRay (Input.GetTouch(i).position);
if (Physics.Raycast (ray)) {
// Create a particle if hit
Instantiate (particle, transform.position, transform.rotation);
}
}
}
}

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 pixelboi · Dec 09, 2010 at 05:22 AM 0
Share

Does anyone know why or if there is a fix? Can you help me fix it

1 Reply

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

Answer by Eric5h5 · Dec 09, 2010 at 05:30 AM

It works fine. I guess you're using an older version of Unity iPhone, in which case you should use the documentation that came with it instead of the online docs (which are always going to be for the most recent version), since Input was handled somewhat differently then. Or upgrade.

Comment
Add comment · Show 5 · 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 pixelboi · Dec 09, 2010 at 05:40 AM 0
Share

I have Unity 1.7? What version are you using? What is the fix?

avatar image Eric5h5 · Dec 09, 2010 at 05:59 AM 1
Share

Unity 3.1. I already told you the fix: use the documentation that came with Unity iPhone 1.7.

avatar image pixelboi · Dec 09, 2010 at 01:24 PM 0
Share

Okay, do you have a link to the 1.7 documentation? I see no option to read the old versus the new. I googled for the old docs. Perhaps I'll ty the forum and see if maybe someone knows. Thanks for the help mate.. It's frustrating sometimes - but we'll all get there

avatar image Eric5h5 · Dec 09, 2010 at 07:17 PM 1
Share

Once again, you need to use the documentation that came with Unity iPhone 1.7. There is no link to it, it's on your hard drive, in the folder called Documentation.

avatar image pixelboi · Dec 09, 2010 at 08:35 PM 0
Share

Thanks mate.. all I need was the correct syntax "iPhoneInput.GetTouch" From a learning perspective it's good you did not give me the solution..

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

No one has followed this question yet.

Related Questions

Unable to load Unity iPhone examples as scenes 1 Answer

BCE0019: is not a member of 'UnityEngine.Component' when trying to Build and Run iOS Unity 2 Answers

does the iPad have a max FPS 2 Answers

Frames per second capped at 30 for iPhone? 1 Answer

Make my gun model fire bullets 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