Theotherguy
Level 1
|
|
« Reply #60 on: January 05, 2010, 06:09:43 PM » |
|
You just add a collider yourself in the GUI, then set the properties there.
Component -> Physics -> Sphere Collider
You can edit a collider in script either by using
this.collider or just collider
Or you can probably do something like: var sphereCollider = GetComponent(SphereCollider);
Oh I see! But how do I listen for collisions using it then? I know that collisions are handled using the "OnTriggerEnter" and "OnTriggerExit" etc. methods, but I'm not sure how to decide which collider I am getting the collisions from. If a gameObject has any colliders, do all of them call those methods? EDIT: It looks like game components can only have one Collider. This is very confusing. You see, what I am trying to do is have a collision sensor attached to a game object which does not in any way affect its motion and instead just registers collisions which I can then use to handle collision events. My aim is to make a basic range sensor in which an object can find other game objects, and then follow the closest one that has certain properties.
|
|
« Last Edit: January 05, 2010, 06:13:38 PM by Theotherguy »
|
Logged
|
|
|
|
Alec
|
|
« Reply #61 on: January 05, 2010, 07:19:41 PM » |
|
For that you'd want a trigger. You only get OnTriggerEnter callbacks if you have the collider set to be a trigger. Triggers go through stuff.
Otherwise you use OnCollisionEnter.
To get multiple colliders, you'd set up a hierarchy. (parent other gameObjects with colliders to the main gameObject)
|
|
|
Logged
|
|
|
|
Alec
|
|
« Reply #62 on: January 19, 2010, 05:12:06 PM » |
|
New tutorial up! http://infiniteammo.ca/blog/tutorial-tuesday-collision-and-messaging/At time of writing, some of the youtube videos are still uploading. But in a few hours the whole thing should be ready to consume. This one is a fair bit more complicated, so if you have any questions please let me know. (I may even do another video to explain it or something) If you have any "requests" (specific things you'd like me to talk about) for next time, let me know about that too.
|
|
|
Logged
|
|
|
|
Cagey
|
|
« Reply #63 on: January 22, 2010, 09:51:26 PM » |
|
It appears that the zip file for Schpooter is corrupted. I wasn't sure if it was just me, but there have been a couple of people on youtube with the same problem. The first tutorial was awesome though! Thanks
|
|
|
Logged
|
|
|
|
Alec
|
|
« Reply #64 on: January 22, 2010, 10:10:35 PM » |
|
It appears that the zip file for Schpooter is corrupted. I wasn't sure if it was just me, but there have been a couple of people on youtube with the same problem. The first tutorial was awesome though! Thanks I'm guessing it's only broken on Windows? I'll try to get a fix up tomorrow.
|
|
|
Logged
|
|
|
|
Cagey
|
|
« Reply #65 on: January 22, 2010, 10:21:50 PM » |
|
Na, I'm on Snow Leopard. I tried downloading it in Firefox instead of Chrome, but it was still borked. Not sure whats going on... it appears to be downloading a corrupted zip of the Schpooter app.
|
|
|
Logged
|
|
|
|
|
Cagey
|
|
« Reply #67 on: January 25, 2010, 03:50:30 PM » |
|
That worked. Thanks
|
|
|
Logged
|
|
|
|
Rskennan
|
|
« Reply #68 on: February 04, 2010, 12:04:20 AM » |
|
I just want to thank you for these tutorials. I usually dislike video tutorials for things like blender, since I learn abstract things best by reading, but for some reason your stuff goes over well with me.
Anyway, the latest tutorial on messaging and colliders is exactly what I needed to find today. I had gotten the logic of how my interactions would need to work in unity, made my prefabs, and promptly got stuck since I come more from the right brained side of things. This kind of "do this, do that" instruction is very helpful for helping me exercise the other half of my brain.
I'll watch the last 2 or 3 videos in this tutorial a couple more times, but I'm on my way to getting it. And this coming from a guy who hasn't programmed since 8th grade with a TRS-80. :D
Thanks.
|
|
|
Logged
|
|
|
|
Alec
|
|
« Reply #69 on: February 04, 2010, 12:08:23 AM » |
|
|
|
|
Logged
|
|
|
|
skyy
|
|
« Reply #70 on: February 06, 2010, 05:07:21 PM » |
|
Thank you. I personally don't use Unity, but I find it so interesting to see how technology works so I ended up sitting down, installing Unity and following through your tutorials. Just to at least have the BASIC OF BASICS knowledge on Unity too just in case I might need it. You never know where the road may lead you. Great job with the tutorials. Easy to follow and you take time explain how stuff works. Rock on
|
|
|
Logged
|
|
|
|
Alec
|
|
« Reply #71 on: April 03, 2010, 10:20:27 AM » |
|
Here's a new one! I released the project files for my GammaIV entry: (with video overview) http://bit.ly/dpB9zn
|
|
|
Logged
|
|
|
|
bateleur
|
|
« Reply #72 on: April 04, 2010, 10:55:18 PM » |
|
Wow! Thanks Alec - amazing resource! Makes me a little sad that I'm in the middle of three projects none of which are using Unity... maybe next time.
|
|
|
Logged
|
|
|
|
LeFishy
|
|
« Reply #73 on: April 11, 2010, 06:41:15 PM » |
|
Wow! Thanks Alec - amazing resource! Makes me a little sad that I'm in the middle of three projects none of which are using Unity... maybe next time. ahem... Yeah maybe I should watch these
|
|
|
Logged
|
|
|
|
Alec
|
|
« Reply #74 on: May 07, 2010, 05:40:52 AM » |
|
|
|
|
Logged
|
|
|
|
Eraser
Guest
|
|
« Reply #75 on: May 08, 2010, 03:31:06 AM » |
|
Having a tutorial for a GUI of 3d models would be much appreciated, as your video hinted at for a future tutorial. I imagine all I'd need to do is figure out how to check if a model has the mouse over it / click on it and I'd be able to do whatever other effects I want myself.
|
|
|
Logged
|
|
|
|
|
Choco Man123
TIGBaby
|
|
« Reply #77 on: May 18, 2010, 04:13:40 PM » |
|
So I love the tutorials and you are open to suggestions for the future so I thought I'd post my thoughts. I think it would be totally awesome if you could do an AI tutorial. Keep it up!
|
|
|
Logged
|
|
|
|
Eraser
Guest
|
|
« Reply #78 on: May 18, 2010, 08:13:49 PM » |
|
The only thing that's currently bugging me about Unity is (based off of a forum post on the unity forums) that it doesn't do real time lighting with, I'm guessing raycasting so light will actually not go through walls (and other models) to cast shadows.
|
|
|
Logged
|
|
|
|
Alec
|
|
« Reply #79 on: May 18, 2010, 08:21:46 PM » |
|
Huh? No realtime engine does true raytracing. But you can make walls cast shadows and stuff... Only in Unity pro though. Unity 3.0 is going to have crazy fast lighting options (deferred, and crazy shadow mapping stuff)
|
|
|
Logged
|
|
|
|
|