Not asking. Is requesting a copy/paste code.
C# bool active when player collides with object
Hello there everyone. I'm completely new to scripting so I don't really know much yet. But let me explain the script I really badly need that google keeps giving me search results for everything but that.
So i'm doing a mobile game. Well... porting Halo to android. So let's say there's a weapon on the floor and I put a cube into it for the collider but I enable "isTrigger" so you can pass through. When my player collides with that collider I want it to set a gameobject active (for example a canvas) until my player stops touching that collider. If anyone can do this script for me I will be so thankful.
So lets say I attach the script to the cube. Could you guys do the script like:
public gameobject Player public gameobject ObjectToActivate
Or if you want, to do the tag "Player" instead of public gameobject Player if it is easier for you. If there's anyone that can do the script for me, I thank you in every way possible and I really appreciate you helping me.
Answer by tormentoarmagedoom · May 06, 2019 at 11:28 AM
Hello @naiemali1171987
Unity Answers is, as its name says, a place to ask something and get answers, but is not a code provider. If you need help with some function, or compoenent, we will help you with pleasure. But you can not expect to recieve a code ready for copy and paste to your project.
Spend your time waching tutorials, and write your own code. TRy try and try. And if do not succeed, come here, paste your code, explain what you have, what you expect and we will try to help you.
Good luck!
Bye!