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 Joey · Jun 21, 2010 at 04:48 AM · fpsshootingaimcrosshair

crosshair help needed

hello everyone

i have a cross hair in my third person shooter game and it moves around with my mouse. so basically where ever my mouse is that's where the cross hair is as well. I need help making it so that my bullets that my character fires land within the cross hair that i have. i also want my player to turn to face which ever direction the cross hair is facing because it can spin in a 360 degree angle. any help will be really appreciated. i have little experience with scripting so please try to help me.

thanks in advance

Comment
Add comment · Show 1
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 qJake · Jun 21, 2010 at 06:02 AM 0
Share

Please be aware that we aren't going to give you a script that you can just plug into your game and it'll "just work". Unity requires pretty solid program$$anonymous$$g skills if you want to make games, so you should look under the Scripting section of this page to begin learning how: http://answers.unity3d.com/questions/4897/how-can-i-start-learning-unity-fast

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Thomas Hentschel Lund · Jun 21, 2010 at 10:08 AM

Having done these 3rd person crosshairs before, the way to do it is to shoot a ray from the camera through your crosshair (I take it that its at the center of the screen - and thus the camera ray would automagically go through it) - and then see where your crosshair collides with geometry.

You then use THAT position to point your character and his gun towards.

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
1

Answer by Ashkan_gc · Jun 21, 2010 at 07:09 AM

there is a complete in depth FPS tutorial in unity's website. basically you can use mouse look script of standard assets and always draw a crosshair in center of the screen.

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

No one has followed this question yet.

Related Questions

Machine Gun aim to crosshair 3 Answers

How make Raycast Aim to Crosshair? 1 Answer

Reload Ammo is not working 1 Answer

My crosshair is moving the opposite of the mouse position. Why? 1 Answer

Avert Fate Style FPS Gun Script 3 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