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 cdrandin · Jan 06, 2013 at 08:57 PM · gameplaymechanics

How to get player to follow a "tracer"

So, how I want my game to work is entirely using 2D physics. The catch how I want my game to work is that the environment is all 3D and so the player can do the normal left/right and up/down, but the catch is I want him to move along the Z axis as well, but without having input control over it, but rather it is indirectly down, by following this tracer when it chooses to move along the Z axis.

So let me try and paint a picture. Say, you have a narrow hallway that only goes left and right, so the restriction in movement only works for Horizontal and Vertical movement, BUT when we reach the end of the hall way there is another hallway leading out, so instead of having the player press up to move forward, we just press 'D' or '->' to make him turn into that hallway, which is done because he is following this "tracer". So in sense the movement Left and Right is working in relation to this tracer.

So think about this image http://img.nobodybuy.com/2010/01/07/sales34776/0x0_p606558/bead-game-bead-maze-toy.jpg and would only be controlled with a left and a right toggle on the keyboard, which in the image uses all 3 dimensions. I have a slight idea on how to make it work, but was wondering if some one could help flesh out this idea. Also, I would need to rotate the player to look more realistic and the camera is attached to the player.

Edit: Was hoping someone know some method in Unity which could act as a tracer. Meaning I am restricted to this path only and the toggled input act according to this tracer.

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

1 Reply

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

Answer by robertbu · Jan 11, 2013 at 06:34 PM

I'm not sure I understand your description. Based on the picture, what I would do is create an array of Vector3's to describe the path. I would create an empty game object. Moving forward would move the empty game object along the path AND rotate the game object so that it was facing along the path. Next I would create a child game object representing my character (a bead in the photograph). I would use transform.localPosition to move the bead up/down/left/right. This will move the bead relative to the parent game object on the path.

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

9 People are following this question.

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

Best way to make dynamic surface interactions 0 Answers

Need advice in approaching a visibility mechanic through collision [Unity3d] 0 Answers

Is there a good approach to implementing battle damage to clothes? 1 Answer

Hop (Ketchapp) Mechanic (Jump between platforms with certain velocity while controlling object on X axis) 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