mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 11:02:24 +02:00
Merge pull request #4284 from sethalves/fix-butterflies
if butterflies stop moving, they are no longer kinematic, so give them a velocity
This commit is contained in:
commit
5c048db5f5
1 changed files with 6 additions and 1 deletions
|
@ -13,6 +13,9 @@
|
|||
//
|
||||
|
||||
|
||||
print("BUTTERFLIES START");
|
||||
|
||||
|
||||
var numButterflies = 25;
|
||||
|
||||
|
||||
|
@ -109,7 +112,7 @@ function updateButterflies(deltaTime) {
|
|||
var properties = Entities.getEntityProperties(butterflies[i]);
|
||||
if (Vec3.length(Vec3.subtract(properties.position, flockPosition)) > range) {
|
||||
Entities.editEntity(butterflies[i], { position: flockPosition } );
|
||||
} else if (properties.velocity.y < 0.0) {
|
||||
} else if (properties.velocity.y <= 0.0) {
|
||||
// If falling, Create a new direction and impulse
|
||||
var HORIZ_SCALE = 0.50;
|
||||
var VERT_SCALE = 0.50;
|
||||
|
@ -139,3 +142,5 @@ Script.scriptEnding.connect(function() {
|
|||
Entities.deleteEntity(butterflies[i]);
|
||||
}
|
||||
});
|
||||
|
||||
print("BUTTERFLIES END");
|
||||
|
|
Loading…
Reference in a new issue