entitydistance in x & z ONLY??
Blitz3D Forums/Blitz3D Beginners Area/entitydistance in x & z ONLY??
| ||
I'l trying to make an automatic door that slides upwards if the character gets too close to it (and slides down when far away and up). entitydistance wont work because as the door moves up, the distance between the two increase, and unless the character itself is actually moving, it will remain stationary (the two arguments of "if distance is this far then move down, but if distance is this close then move up" condradicting eachother, causing it to kinda vibrate in place) thanks :D |
| ||
Either: x# = EntityX(door) - EntityX(player) z# = EntityZ(door) - EntityZ(player) dist# = Sqr(x*x + z*z) Or: Stick a stationary pivot at the door position and do distance check against that, instead of the door mesh. |
| ||
thanks, that should do it, (i'm gonna have a ton of doors, so the stationary pivot would just take too long, but the above equation oughta do it, thanks!) |
| ||
Well, you could always create the pivots and parent the doors to them. The choice is yours, though. ;) |
| ||
would this work for 2d also? |
| ||
yes |
| ||
ok, thanks. |