OnTouch
-
My only real problem with the way this works is there's no way to do something different if it's not touching anything. At the moment, I can set a variable when it's colliding with something, but I can't set it back to something else when the collision stops (using the setVar/getSetVar method is very unstable). I think there should be two script boxes, one for true, and one for false. Then I can do:
TRUE:
setVar("foo",1)FALSE:
setVar("foo",0)To achieve the results I want. This'd also let me detect individual hits using script, which, combined with the features in the upcoming version, could let me reduce var "health" every time the player is hit by weapons fire, with the damage calculated by which round he was hit with.
-
@wacov said:
My only real problem with the way this works is there's no way to do something different if it's not touching anything. At the moment, I can set a variable when it's colliding with something, but I can't set it back to something else when the collision stops (using the setVar/getSetVar method is very unstable). I think there should be two script boxes, one for true, and one for false. Then I can do:
TRUE:
setVar("foo",1)FALSE:
setVar("foo",0)To achieve the results I want. This'd also let me detect individual hits using script, which, combined with the features in the upcoming version, could let me reduce var "health" every time the player is hit by weapons fire, with the damage calculated by which round he was hit with.
Use getSetVar('foo') on whatever uses the variables. setVar('foo') on the ontouch field. when the box is being touched the variable will be 1. when not touched getsetvar resets it to 0 and deactivates whatever its bin put on. Basically just use getset instead of get
-
I just did a little experiment. I was wrong, the method you use isn't unstable; the problem is, collisions aren't detected while two objects are intersecting each other, it's more about the faces. If onTouch collisions could be detected using intersection, as well as the normal way, then noCollision detectors would work properly. See what I mean here: Sphere will emit while collision is detected.
I managed to overcome this (somewhat), and I've found a way to create artificial super-grip for my new vehicle, with a thruster; which only has an effect while it's driving over something. When you jump, it's turned off, so you get immense air time, since there's no need for a gravity increase and the grip vastly increases the speed of the car. The thruster is gyro-stabilised (no vertical driving) and set well below the car, stopping roll during cornering. I'll upload it when I get it looking a bit nicer.
-
ctually, this has been done before, look at my most recent wildcat, it uses this method, it has a sensor that detects how far off the ground you are.
-
You keep beating me to this kinda thing
-
i try my best. ps. I've also beat you to the menu system http://sketchup.google.com/3dwarehouse/details?mid=99bca3f10e5596eb6deb668485598dc6&prevstart=0
-
What the hey, I'll post my system... excuse the lack of steering wheel, engine, or, indeed, anything to hold the wheels in place... oh and I saw. To be honest, it's nothing like what I was thinking of, but nice!
-
works well, what were you think of then with your menu system?
-
-
HGreat SPing there. Hope you can use it to make a game
-
Very cool stuff!
Regarding onTouch, the current plan is to have an onTouch and an onUntouch event. Strictly speaking it should probably be onTouch (first touch) onTouching(every touch until..) onUntouch (only happens once when object stops touching). But I dont know if I am going to take it that far.
-
If you used the add/remove event thing, then these would be great events to have; please use them! For the onTouching, would you be able to detect it outside of the physics engine, using SketchUp? The engine doesn't detect intersections very well, as I demonstrated...
Advertisement