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 /
avatar image
0
Question by archelyte_vz · Jun 11, 2019 at 12:47 AM · fpsprojectileprojectilesufps

UFPS Projectile Spawn Point (SOLVED)

Hopefully this will help someone.

Ok, I searched for days to find the answer to this, but nobody had a solution for it. UFPS 2 actually deals with the ability to spawn projectiles from a set point, but it has so many missing features at the time of this writing, that it's no worth it to use over UFPS 1, and as such, there are still many, many users who are utilizing UFPS 1.

After days of fighting with the code, I managed to find the solution, so I'll post it below for anyone who needs it.

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
Best Answer

Answer by archelyte_vz · Jun 11, 2019 at 12:49 AM

Here's the solution I came up with

First, each weapon has a GameObject in it child heirarchy that is named "Muzzle", and if yours doesn't then you need to put it there for this to work.

Second, you need to locate the weapon prefab that you put in the "1st person weapon" slot under the render tab of vp_Weapon. Then give the prefab the tag "WeaponParent". It is important that you do this to the prefab and NOT the GameObject attached to your player!

Third, you locate the GameObject named "Muzzle" that is a child of the weapon prefab and give it the tag "MuzzlePoint".

Lastly, you are going to edit the script vp_FPWeaponShooter after line 269 which should be

 if (Player.IsFirstPerson.Get())



After that specific line of code, place this

 foreach (Transform child in transform)
                 {
                     if (child.CompareTag("WeaponParent"))
                     {
                         foreach (Transform grandChild in child.transform)
                         {
                             if (grandChild.CompareTag("MuzzlePoint"))
                             {
                                 m_ProjectileSpawnPoint = grandChild.gameObject;
                             }
                             else
                             {
                                 m_ProjectileSpawnPoint = Transform.GetChild(0).Find("Muzzle").gameObject;
                             }
                         }
                     }
                 }



What this does is locate the muzzle GameObject and sets it as the spawn point for the projectile. You'll then have to give the projectile it's own movement script if you haven't already.

If the spawn point is still a bit off, you'll have to adjust the location of the muzzle as shown in this tutorial

https://www.youtube.com/watch?v=OiyDit9KwOk&list=PLgtYBAm7mQcjRZie7GGeMgLACu1uimKte

Hope this helps, Cheers!

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
0

Answer by sas67uss · Jul 26, 2020 at 09:21 PM

very nice . do you know how can modify ufps scripts to that the Crosshair and ProjectileSpawnPoint follow the weapon recoil motion after firing and generally weapon motions in bob and shake and etc? As default the crosshair and fire point has been freezed in center of screen and it is very bad .

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

143 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 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

Bullet ricochet 0 Answers

UFPS and Photon 0 Answers

Gun Fire, sparks on Collision 1 Answer

How do i adjust the projectile path and direction? 1 Answer

Questions about a Bow and Arrow FPS setup 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