|
How do you make a cube fall after you move a box on it then off it. So its there when you walk on it but when you walk off it falls doawn.
(comments are locked)
|
|
I have many "Collider" in my scene that are likely to pass through my trigger box, but I only want my player to set off the trigger box, is "Collider" the word that I need to be replacing in this script? If so... what with?
(comments are locked)
|
|
There are a few ways, but the simplest one (the one I'd go for) would be to link a trigger volume on top of it, something like this: First, make your rigidbody block, nice and simple. Set it to 'kinematic' so that it doesn't just fall straight away. Then, make an invisible, trigger collider that sits above it, and add something similar to the following script:
Then, make sure that you assign the correct block to the 'LinkedBlock' property, and set up some system for determining which object the player is, and you're set to go! Sorry about repost (new). OK im slightly confused on what i need to change in code. I made linkedblock;Platform which is what i want to fall and everything else im confused on. Cube is player that moves around, Trigger is the trigger, and Platform is what needs to fall.
Mar 17 '12 at 12:58 AM
ctechnoboy87
Oh, you're working in JavaScript? Why? Also, you should have told me. Seriously, this is working code here. Just make the Platform a rigidbody, so that it can fall (otherwise it won't ever fall without special code), and make sure that the player can trigger triggers (needs to have at least one rigidbody involved). Here's a javascript version, if you want: Put that script on a trigger, and then drag the platform onto the slot exposed in the inspector. I'm really not sure how much more clear I can make this.
Mar 17 '12 at 05:28 AM
syclamoth
Do I put this in function start, update, or neither. I changed if (/other is the player, determine this however you like- / true) to if (gameobject.Cube = true) not sure if I did that right and when I try to run it, it says compiler errors.
Mar 19 '12 at 10:40 PM
ctechnoboy87
What does compiler says?
Mar 19 '12 at 11:02 PM
Dakwamine
Need to fix all compiler errors.
Mar 19 '12 at 11:09 PM
ctechnoboy87
(comments are locked)
|
