Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 rowdyp · Nov 16, 2011 at 03:16 AM · buttonmovment

fps move forward on GUI Button Press

Hello, I am currently making a First Person Exploration game. I am trying to get my movement working. Exploring will be similar to old school FPS (think wolfenstein 3d and original doom with no looking up or down) I want to create up, down, left, and right buttons on the GUI. Then have the player move up or down on click or rotate left or right ninety degrees with the left and right buttons. Any ideas? Thanks in advance.

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 syclamoth · Nov 16, 2011 at 03:20 AM 0
Share

Why on the GUI? Is this for iOS or Android?

avatar image rowdyp · Nov 16, 2011 at 03:42 AM 0
Share

its for webplayer, don't ask me, that is the way the client wants it

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by jahroy · Nov 16, 2011 at 03:35 AM

I would start by looking at the scripts that come in the Standard Assets folder.

In the subfolder named Scripts there are a bunch of scripts that deal with camera movement and user input.

Here is some documentation for handling user input:

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

 

I would also check out the Unity Wiki, which has tons of sample scripts that deal with this.

Here's an entire page full of camera control scripts:

 http://www.unifycommunity.com/wiki/index.php?title=Scripts/Controllers



Here's an entire page full of GUI scripts:

 http://www.unifycommunity.com/wiki/index.php?title=Scripts/Controllers

 

I would also recommend searching this site for questions similar to yours.

Here are a couple I found by searching for camera movement:

 http://answers.unity3d.com/questions/26263/camera-scripting-references.html

 http://answers.unity3d.com/questions/54693/camera-movement-script.html
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
avatar image
0

Answer by rowdyp · Nov 16, 2011 at 03:41 AM

cool thanks

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
avatar image
0

Answer by Diegosl1207 · Jan 31, 2017 at 08:46 AM

I make a example in a first control person in unity 5 (maybe helps you):

  • Add default prefab of first control person;

  • Desable firstPersonalControl script default;

  • Add this script below;

  • In a rigidbody: freeze position Y and freeze rotation X, Y and Z.

Sorry for the english...

using UnityEngine; using System.Collections;

public class walkOnFaceDirection : MonoBehaviour {

 // Use this for initialization
 void Start () {
 
 }
 
 // Update is called once per frame
 void Update () 
 {
     
     var x = Input.GetAxis("Horizontal") * Time.deltaTime * 150.0f;
     var z = Input.GetAxis("Vertical") * Time.deltaTime * 3.0f;        

     transform.Rotate(0, x, 0);
     transform.Translate(0, 0, z);
 }

}

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Checking if Button is not pressed 1 Answer

i done this b4 but forgot :( touch screen 2 Answers

IsPointerOverGameObject doing the opposite of what I want 0 Answers

Problem Button Click with Cursor, Cursor attach the gameobject 2 Answers

Method added on a button click with a delegate is being called twice. 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