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 d3us3xmachina · Jul 02, 2013 at 05:08 AM · cameracontrolsthird-persontransitionsidescroller

Is there any way to transition from third person to sidescroller?

Hello! My problem seems really simple, and yet I can't figure out how to accomplish this! alt text

The red star is my enemy, with the circle being his territory, If the green star enters the large red circle, a variable "Battle" is set to true. The green star is the player who can move forward and back and turn left and right, he is followed by the camera (blue) which is controlled by a standard smooth follow script when battle = false. alt text

Upon the battle variable going true, the camera focuses on a dummy object childed to the enemy, which stays exactly halfway between the enemy and player. this is where i run into my issue. The two characters can now only jump and move towards or away from each other, essentially transitioning from a 3rd person rpg to a street fighter style combat system. I want the camera to remain normal to the vector between the two characters, and on the same side. But it seems to not stay normal, and when the characters turn around, the camera changes the side of the battle it's on. Also, the left and right buttons don't work the way I'd like. When you press right you want your character to go right, and left when you press left, but the right button always move the player closer to the enemy, and the left button away from him. Sorry for the long question, I can provide my code if you like, Thank you in advance!

battleisfalse.jpg (40.8 kB)
battleistrue.jpg (42.0 kB)
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
0

Answer by Kiloblargh · Jul 02, 2013 at 05:17 AM

Upon the battle variable going true, the camera focuses on a dummy object childed to the enemy, which stays exactly halfway between the enemy and player. this is where i run into my issue.

Don't child it to the enemy. Just set its world position to a point between the enemy and player in Update. Have it look at the enemy, then have another dummy object a child of that, at 90º (on its +x local axis) . Adjust the local position of dummy 2 relative the distance from the player to the enemy. You can have the camera rig move from its original position to dummy2's position with SmoothToward so you get a visual swoop-down transition.

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 d3us3xmachina · Jul 02, 2013 at 07:22 PM 0
Share

I think I actually have a solution: use a custom function to set the value of a vector from the player to the enemy (or from the enemy to the player), delete the Y component, multiply it by 3 or 4, and don't continue to update it. This will create a point for the Player object to move towards and away from that is well outside of the combat field. Then, don't rotate parent objects, rotate the children. This means the player and enemy objects will continue to face the same direction but the meshes will rotate to face each other.

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

15 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

Related Questions

2d camera scrolling 0 Answers

Issue with my camera controls 0 Answers

Camera Viewport Height - Horizontal Transition 0 Answers

Movement object same distance as touch movement 0 Answers

Transition a camera from ortographic to perspective mode (Trombone effect) 2 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