Search the Community
Showing results for tags 'collisions physics'.
-
Hello again, Once more, I'm having some issues with the collision system. I have an object in my game that I want to have bouncing back and forth between the map walls that will act as an obstacle for the player character. I cannot use a physics object for this, as it makes the object's behavior inconsistent and difficult to control after its first collision. However, with its Mass set to 0, it no longer registers collisions with the map walls. It will collide with a player character (which is a physics object) and react as it is supposed to, just not with the walls or any other non-physics object placed in the scene. What can I do to correct this and have it register collisions with non-physics objects? Thanks! I don't think it is helpful, but I have included the object's settings and script below, just in case. Settings: Physics Mode: Rigid Body Collision Type: Character (I have tried every available type and none of them solve this issue.) Mass: 0 Character Angle: 0 Swept Collision: False Nav Obstacle: False Script.moveSpeed = 5.0 --float "Movement Speed" Script.initDir = -90 --float "Initial Direction" function Script:Start() self.entity:SetRotation(0, self.initDir, 0, true) self.entity:SetMass(0) dirFlip = 1 end function Script:UpdateWorld() self.entity:Move(0, 0, self.moveSpeed * dirFlip, false) end function Script:Collision(entity, position, normal, speed) dirFlip = dirFlip * -1 end