AggrorJorn Posted February 2, 2015 Share Posted February 2, 2015 I have a hitbox on the players location. When the player dies it loads in a lowpoly shape (default script of the FPS player script.) However the loaded shape, is now intersecting with the hitbox, which causes the lowpoly shape to start twitching around. To resolve this issue I first thought that simply hiding the hitbox entity would solve the problem, since hidden entities no longer have physics interaction. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entityhide-r181 However this didn't help at all. The loaded shape was stil flipping around like it was intersecting with the hitbox. Releasing the hitbox resolves the problem, but that is not what I want to do, since I want to restore the hitbox. --This script works, since the hitbox is released. hitbox:Release() shape: Load() --This script doesn't work, even though the hitbox doesn't have any collision. hitbox:Hide() shape: Load() Other things I tried: Setting the collision type of the hitbox to NONE. Things I haven't tried yet: Loading the lowpoly shape 1 frame later after hiding the hitbox. Repositioning the hitbox to a different location. Any thought on what this could be? Quote Link to comment Share on other sites More sharing options...
YouGroove Posted February 2, 2015 Share Posted February 2, 2015 it loads in a lowpoly shape (default script of the FPS player script.) However the loaded shape, is now intersecting with the hitbox, which causes the lowpoly shape to start twitching around. Any loaded model with no physics will not interact with physic shapes. You chouls try to make a prefab with no collision setting in the editor and no collision volumes and try loading that prefab instead, or are you already loading it as prefab ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 2, 2015 Author Share Posted February 2, 2015 The FPS script loads a lowpoly shape to a pivot (not a model/prefab) that is used as corpse. self.corpse = Pivot:Create() local shape = Shape:Load("Models/Characters/Generic/corpse.phy")--this shape is made from a low-poly CSG sphere, so it will roll around a bit but come to a stop quickly self.corpse:SetShape(shape) self.corpse:SetCollisionType(Collision.Prop) The loaded shape (corpse) behaves as intended, it is the hitbox that causes the issue. It should not cause collisions or collision twitching since it is hidden (and/or) collisiontype gets set to none. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted February 2, 2015 Share Posted February 2, 2015 It should not cause collisions or collision twitching since it is hidden (and/or) collisiontype gets set to none. Or this is a bug, or collision should not be called in a pivot, or collisionType can't work with Shape:Load(ZZZ.phy) ? self.corpse:SetShape(shape) Or i'm not sure the pivot to be aware of the attached shape ? I just find very strange this way of working by code. Why not just load a model with physics and save it as prefab or do you need some things to be dynamic , in that case prefab is not the solution ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 2, 2015 Author Share Posted February 2, 2015 This is not something I have written, as it is part of the deafult FPSscript. There is no model/prefab being loaded. The corpse is just a shape (.phy) which is set to the pivot. The pivot is placed at the position of the player. By the looks of it, hiding an entity, does not disable the physics of the object (right away), because other objects are interfering with it. I have to try out if this is actually the case in other scenarios. Quote Link to comment Share on other sites More sharing options...
BluHornet Posted February 2, 2015 Share Posted February 2, 2015 Would using collision type debris instead of prop for the corpse work. I assume your hit box is a collision character? Debris will collide with scene and prop only. I had to do this for items dropped by enemies due to the one following "tripping" over the drop. Quote Link to comment Share on other sites More sharing options...
Josh Posted February 2, 2015 Share Posted February 2, 2015 If you can write a simple little example that demonstrates the problem it would make it easy to fix. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.