My Learning
Pathways
Guided learning journeys
Embark on a guided experience where you unlock free assets, prepare to get Unity Certified, and earn shareable badges to demonstrate your learning to future employers.
Unity Essentials
Pathway
Foundational
+600 XP
2 Weeks
Designed for anyone new to Unity, this guided learning journey is your first step toward gaining the background, context, and skills you need to confidently create in the Unity Editor and bring your vision to life. Experience hands-on learning as you discover what’s possible with Unity and unlock free assets to support you in creating your best projects. Completing this Pathway will equip you with the foundation you need to further your learning and specialize in your area of interest.  
Junior Programmer
Pathway
Beginner
+3000 XP
12 Weeks
Welcome to Junior Programmer! Designed for anyone interested in learning to code or obtaining an entry-level Unity role, this pathway assumes a basic knowledge of Unity and has no math prerequisites. Junior Programmer prepares you to get Unity Certified so that you can demonstrate your job-readiness to employers.
Browse
TOPICS
Editor EssentialsScriptingGraphics & Visual Effects2DMobile & TouchXRPhysicsUser InterfaceFor EducatorsAI & NavigationMore
Pathway
Mission
Course
Project
Tutorial
Guided learning experiences
Gain the Unity skills you need to advance your goals and bring your vision to life.
Unity Essentials
Pathway
Foundational
+600 XP
2 Weeks
Designed for anyone new to Unity, this guided learning journey is your first step toward gaining the background, context, and skills you need to confidently create in the Unity Editor and bring your vision to life. Experience hands-on learning as you discover what’s possible with Unity and unlock free assets to support you in creating your best projects. Completing this Pathway will equip you with the foundation you need to further your learning and specialize in your area of interest.  
Junior Programmer
Pathway
Beginner
+3000 XP
12 Weeks
Welcome to Junior Programmer! Designed for anyone interested in learning to code or obtaining an entry-level Unity role, this pathway assumes a basic knowledge of Unity and has no math prerequisites. Junior Programmer prepares you to get Unity Certified so that you can demonstrate your job-readiness to employers.
Live
TOPICS
Browse All Topics
ALL
TUTORIALS
PROJECTS
COURSES
MISSIONS
PATHWAYS
See all 0 Results
FAQ
Create a Unity ID
Sign in
g
gamingandgeeking
Dec 1, 2019
Hello All
I was wondering if anyone could help with a snag im hitting. I want pickups to update a variable in the weaponController but even though i have new function built I cannot seem to get the weaponPickup to be able to call the weaponController function.

Comments
Mark McCorkle
a year ago
Unity Padawan
Oh man, connect sure does butcher screenshots with super low resolutions -- so it is kinda hard to read what you posted, but I think this is what you were trying to do: in WeaponPickup.cs: public class WeaponPickup : MonoBehaviour { public int ammoInThisContainer; <OTHER STUFF> void OnPicked(PlayerCharacterController byPlayer) { <OTHER STUFF> if ( ammoInThisContainer > 0 ) { Debug.Log("adding ammo to weapon for player " + ammoInThisContainer); weaponPrefab.UpdateTotalAmmo(ammoInThisContainer); } } and in WeaponController.cs: public class WeaponController : MonoBehaviour { <OTHER STUFF> public int totalAmmo = 0; <OTHER STUFF> public void UpdateTotalAmmo(int ammo) { totalAmmo += ammo; Debug.Log("Total Ammo now: " + totalAmmo); } } I've got some other changes in those two files, but you can see my completed files here: https://www.dropbox.com/s/uzxkdtjpc4s597n/WeaponController.cs?dl=0 https://www.dropbox.com/s/49umpcnnhzygf52/WeaponPickup.cs?dl=0 To use those, I added the weapon pickup (and pickup) script components to a sphere -- and then chose the weapon_shotgun and set the ammo to an amount > 0: https://www.dropbox.com/s/i5y6k5z0x3bi89d/adding_ammo.png?dl=0 Message me directly if you need more details.
0
Copyright © 2021 Unity Technologies
Legal
Privacy Policy
Cookies
Cookies Settings
Language:
English
简体中文
한국어
日本語
Русский
Español
Français
Deutsch
Português