• 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 Oct 16, 2022 at 11:22 AM by tormentoarmagedoom for the following reason:

Problem is not reproducible. No info

avatar image
0
Question by Tiec · Oct 16, 2022 at 05:35 AM · noobnew user

Trying to make it shoot when only touching left side of screen

alt textI’m trying to make it so you can only shoot when touc$$anonymous$$ng one side of the screen but it comes up with an error. I’ve been trying to figure it out for a w$$anonymous$$le.

61896118-dcba-47c5-8ba8-513f86733207.jpeg (125.1 kB)
Comment
Add comment · Show 2
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 Eno-Khaon · Oct 16, 2022 at 06:22 AM 0
Share

If you want usable advice, you'll need to provide a lot more information.

For example:

What do you want out of "touching one side of the screen"? Do you mean 50% of the screen? Do you mean more or less? Have you already sorted that aspect out?

What is the error you're seeing? Is it a NullReferenceError? Where does it address in your script? You can double-click error messages to jump straight to the (approximate) erroneous line and, if that doesn't go where you expect, it still presents a full hierarchy of functions it went through to reach the place where the error occurred.

Finally, since Unity will point you at the line of code where the error occurred, WE CAN'T HELP DIAGNOSE CODE-RELATED PROBLEMS WITHOUT INFORMATION REGARDING THE CODE ITSELF! That doesn't mean it's absolutely necessary to post any of it here (and sometimes, there may be valid reasons why you can't or won't do so), but you'll always get more help if you can provide relevant pieces of your script. For example, when Unity directs you to a given line in a given script, send that (and related, surrounding lines and variable declarations) our way and we will be much more able to provide feedback and/or assistance.

avatar image b4guw1x · Oct 16, 2022 at 01:05 PM 0
Share

You can create an invisible button that covers left %50 of the screen and trigger shoot function when you click this button

0 Replies

  • Sort: 

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

149 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 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

I'm making a mobile game and am trying to make it so you can only shoot when touching the right half of the screen. I can't figure out how I would do this 1 Answer

Can you assign a simple variable directly in Inspector without writing a script? 3 Answers

I’m trying to make it so you can only shoot when touching the left side of the screen 0 Answers

the namespace 'Global::' already contains a definition for 'Chunk' 1 Answer

I’m trying to make it so you can only shoot when touching the left side of the screen. This will be on mobile. I figured I would just add another if parameter, but I have an error I don't know how to fix. 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