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 D3m0nE · Aug 09, 2013 at 03:38 AM · shootingbulletcrosshairaccuracy

Shooting Accuracy Problem

Hello everyone i got problem in My Bullet Script

its Shooting About the CrossHair

CrossHair Script :

 GUI.DrawTexture(new Rect(Input.mousePosition.x - (cursor.width / 2), (Screen.height - Input.mousePosition.y) - (cursor.height / 2), cursor.width, cursor.height), cursor);




And Here is Shooting

 Instantiate(CurrentWeapon.Bullet, CurrentWeapon.SpawnPoint.position, CurrentWeapon.SpawnPoint.rotation)
 
 //and For Moving Bullet [Script inside the bullet prefab]
 
 transform.position = transform.position + Speed * -transform.right; 



alt text

cr err.png (8.1 kB)
Comment
Add comment · Show 4
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 clunk47 · Aug 09, 2013 at 05:31 PM 0
Share

I've posted some code similar to yours in my answer below, take it, test it. Notice I'm not hiding the mouse cursor? This is so you can see that the crosshair center is exactly at the tip of the mouse cursor. This is what you want.

avatar image D3m0nE · Aug 09, 2013 at 06:00 PM 0
Share

in my script the $$anonymous$$ouse Cursor is already in the center of Crosshair

the problem in the bullet direction

avatar image clunk47 · Aug 09, 2013 at 08:22 PM 0
Share

Ok so do you actually have to have a bullet? Or could you stand using raycast to shoot things w/ 100% accuracy? Not sure what you're going for.

avatar image D3m0nE · Aug 09, 2013 at 08:27 PM 0
Share

i have Shooting.CS Script its Instantiate the Bullet

and i have Bullet.CS Script attached to the bullet prefab

it moveing the bullet :

 transform.position = transform.position + Speed * -transform.right; 




and not going to use raycast and i dont want to

0 Replies

· Add your reply
  • Sort: 

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

Multiple Cars not working 1 Answer

Bullets sometimes shoot under map 1 Answer

Random Raycast inside crosshairs 1 Answer

Shooting style like enter the dungeon 0 Answers

I am trying to get my enemy to follow and shoot at my fps i have a script but i am geting errors can someone help me please 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