• 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
-1
Question by EpicGamer928 · Jul 02, 2013 at 04:14 PM · controllermovetap

iOS Tap to move??

This might sound a little strange but I am making a simple game where there is a pig and you have to tap the screen to make it move directly forward. I have no idea whatsoever how to do this because I have only done coding for a little while, plus, I'm still in primary school. I really need a script for the tap to move!

Any code or help will be appreciated!

Comment
Add comment
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

2 Replies

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

Answer by Em3rgency · Jul 02, 2013 at 04:19 PM

Well I recommend reading into programming then :) But for now, here a very detailed iOS beginners guide for unity: http://www.raywenderlich.com/25205/beginning-unity-3d-for-ios-part-13

At the end, it shows you how to make a cube move by touch, so you can use this :)

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 EpicGamer928 · Jul 02, 2013 at 04:24 PM 0
Share

Thanks so much!

avatar image Em3rgency · Jul 02, 2013 at 04:27 PM 0
Share

If that helped, please tick my answer as correct :)

avatar image
1

Answer by ebogguess · Jul 02, 2013 at 04:28 PM

You need an Update method that checks for touches, then moves the object forward. Something like

 void Update() {
     if (Input.touches > 0)
     {
         transform.position += new Vector3(1, 0, 0);
     } 
 }
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 EpicGamer928 · Aug 30, 2013 at 02:35 PM 0
Share

Thankyou!

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

17 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

Related Questions

Multiple Cars not working 1 Answer

Very Simple Left and Right Movement Script [OR] disable dravity on CharacterController? 2 Answers

How can i loop my path instead of it ending on the lasat point 1 Answer

Compiler Error...Help Needed. 0 Answers

Making a block move when its clicked 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges