Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Trashboat95 · Mar 05, 2017 at 12:23 AM · rotationfpsturretexitenter

Help with Enter/Exit modified for a turret or cannon in C#

Hey all, first post!

I'm running into some trouble with the game I'm creating. The core game play revolves around getting in/out of defensive turrets and using them to fight waves of enemies. All of my coding knowledge has been self taught through books, following tutorials and watching videos but I cannot grasp how to get my FPS character to do this. It's weird how simple of a mechanic this is, especially how commonly its found in shooter games and yet there is so little detail on how to go about doing it. I've been trying to use some modified code of getting in/out of vehicles but so far no luck. It would be awesome to have a "Press E to enter" on the GUI show up when within distance of it too.

I'm not looking for someone to write the code for me, I just need a little guidance. I've scoured Google and these forums even for any help at all. Anyone out there got any advice for me?

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

Answer by Commoble · Mar 05, 2017 at 05:22 AM

Part of making a game is taking large problems like this and figuring out how exactly to do them. A good way to approach this problem is to break it down into smaller problems, then breaking each of those problems into even smaller problems, until your problems are small enough to handle fairly easily. This is a fundamental component of engineering, and software engineering is a big part of making a game.

This problem you've brought here is broad to ask in a single question or solve in a single answer, but I can help you start on it. Some of the smaller problems that I can see you'd have to break this down into are (in no particular order):

  • Detect when a turret is near or in front of the player

  • Switch control from the human character to the turret or vice-versa

  • Animate the transition into and out of the turret, if necessary

  • Stop the human character from physically interacting with things he shouldn't when he's in the turret or mounting/dismounting it

  • and anything else you decide that your game requires for this

What I do when I come to a big, overarching problem like this is I write down things I need to do to get it done, finding smaller and smaller things to do until I can't go smaller, until I have a big list of things to work on, then I start doing each of these one at a time. If I think of additional things I need to do or things that would make the game better while I'm doing this, I write those down too, either on my immediate to-do list or "don't forget to do this eventually" list.

Again, the details of you accomplish all of this is up to you. The bullet points above are a good start, but there may be more things you need to account for, or some of the things I mentioned might not apply to your game. Above all, don't be afraid to be creative!

Try your best to break down your problems as small as you can, and give each of your smaller problems your best try, too. The smaller your problems are, the easier they'll be to solve, whether from your own knowledge, or by more clearly seeing what specific bit needs to be googled, or by asking us -- the smaller the problem is, the more detail we can give you in our answers. Coming to us with big problems just gets you long-winded motivational speeches at best, and typically a lot less than that.

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 Trashboat95 · Mar 05, 2017 at 06:26 AM 0
Share

@Commoble Thank you so much for taking the time to write that up! That's exactly the nudge in the right direction I was looking for; I'll write it all out on paper and break it down into the basic manageable pieces and then fit it together in a cut down test project.

It's hard to think like a programmer; but we all have to start somewhere, right?

  • Cheers

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

118 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

Related Questions

Enter door? 1 Answer

normalize two angles, then modify the result? 0 Answers

Limit vertical rotation of Camera 5 Answers

transform.Rotate having no effect 0 Answers

How to rotate camera in FPS with joystick 4 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