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 user-8332 (google) · Jan 16, 2011 at 05:40 PM · shootingaiming

Help me! I cant aim properly

Hi everyone, i just need ur help. I am making a FPS and I add a weapon and some sparks but when i play the game and I shoot the sparks hit far away from where it should hit.

P.S: im using a tutorial from unity 3d downloaded from unity3d.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Jason_DB · Feb 14, 2011 at 01:15 AM

It's probably because the gun isn't lined up properly. To fix that just make sure the object with the gun script is a child of the main camera, and then set its position and rotation to (0, 0, 0).

Another thing that I've found helpful is a "draw ray" script, which basically draws a line showing where a gameobject is pointing. Try dragging this script onto your gun and turning on 'gizmos' in the game view; the red line should show exactly where the gun is pointing ( so you can use that to aim it).

var needsSelection : boolean = false;

function OnDrawGizmosSelected () { if(needsSelection){ Gizmos.color = Color.red; direction = transform.TransformDirection (Vector3.forward) *50000; Gizmos.DrawRay (transform.position, direction); } }

function OnDrawGizmos () { if(!needsSelection){ Gizmos.color = Color.red; direction = transform.TransformDirection (Vector3.forward) *50000; Gizmos.DrawRay (transform.position, direction);

 }

}

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 user-8332 (google) · Feb 14, 2011 at 06:22 PM 0
Share

Thanks DatardlyBanana, i was following ur tutorial when this little problem appeared. Anyway i quittted making videogames cause my computers was to laggy and it froze from time to time. Thank u again and i hope this answer can be useful to other people!!!!

avatar image
0

Answer by Ed 1 · Jan 16, 2011 at 05:48 PM

The weapons parent object need to be in the same place as the weapon otherwise it will fire towards the wrong place. Also you may not have a long enough range as thats one of the variables you can set.

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 user-8332 (google) · Jan 16, 2011 at 07:57 PM 0
Share

I add a machine gun to my FPS and to simulate the shot i put a particle animator in front of the muzzle_flash of the machinegun. In the scene view it is all ok but in the game view no. Also my crosshair is also rotate the same degrees as the shot.

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

Shooter in iOS and a visible Aim line before shooting 0 Answers

Why are my guns shooting lower when my character moves forward? 1 Answer

Best way for setting up shooting mechanics for an FPS? (iPhone) 1 Answer

first Gun fires not well 2 Answers

Bullets follow mouse after shooting in Sidescroller 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