History

disable positionand velocity script edits on grabbed entities

Seth Alves committed 7 years ago

Commit 3ccbd0b1 parent bf469605 files · +26 −0Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 5 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+4−0
@@ -816,6 +816,10 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& · 815 unmodified lines
816816
817817 QString previousUserdata;
818818 if (entity) {
819+ if (properties.hasTransformOrVelocityChanges() && entity->hasGrabs()) {
820+ // if an entity is grabbed, the grab will override any position changes
821+ properties.clearTransformOrVelocityChanges();
822+ }
819823 if (properties.hasSimulationRestrictedChanges()) {
820824 if (_bidOnSimulationOwnership) {
821825 // flag for simulation ownership, or upgrade existing ownership priority