Jump to content

Recommended Posts

Posted

I'm testing out different types of physics pads (Jump pads, boost pads) I've found a couple odd things.

 

1. When you use a jump pad and hit the bottom of a brush my controller(FPS prefab) goes straight through and lands on the top

 

2. when using a force based boost pad, going any direction other than straight will instantly kill you.

 

 

Both pads are based on the JumpPads tutorial.

Posted

*edit* it says I'm not permitted to upload .map files

 

Script.JumpForce = nil --vec3 "Jump Force"
Script.SelectiveCollision = false --bool "Selective Collision"
Script.ColObj = nil --Entity "Collision Object"
Script.Active = false --bool "Active"

function Script:Start()

end
function Script:Enable()
if self.Active == false then
self.Active = true
end
end
function Script:Disable()
if self.Active == true then
self.Active = false
end
end

function Script:Collision(entity, position, normal, speed)
 if (self.SelectiveCollision == true and entity == self.ColObj ) then
		 self.ColObj:AddForce(self.JumpForce)
 elseif (self.SelectiveCollision == false) then
		 entity:AddForce(self.JumpForce)
 end
end

That is my jumppad script

 

 

Both brushes of ground are set to rigid body and scene.

Posted (edited)

Well. at least point 2 makes sence because if you look into the script you will see this part:

function Script:Collision(entity,position,normal,speed)
 if speed>20 then
   self:Hurt(100)
 end
end

which means that if the character collides with something at a speed greater 20 you will be killed instantly.

 

Edit: i of course mean the FPSPlayer.lua script

Edited by beo6
Posted

Well. at least point 2 makes sence because if you look into the script you will see this part:

function Script:Collision(entity,position,normal,speed)
if speed>20 then
self:Hurt(100)
end
end

which means that if the character collides with something at a speed greater 20 you will be killed instantly.

But if I'm still on top of the same brush I'm not colliding with anything new, and that also wouldn't explain why getting pushed straight is ok but not a different direction.

Posted

i don't know your exact level build but you don't need to collide with anything new because collision is called i guess every frame or so when you collide with anything other then a Trigger.

 

Do you still get killed if you comment the line "self:Hurt(100)" out?

Posted

i am not sure. That would require a bit of try and error.

 

My first guess is that it possibly collides again with the Trigger object.

 

Try this to have Triggers not kill your character: (not tested code)

function Script:Collision(entity,position,normal,speed)
 if speed>20 and entity:GetCollisionType()~=Collision.Trigger then
    self:Hurt(100)
 end
end

Posted

i am not sure. That would require a bit of try and error.

 

My first guess is that it possibly collides again with the Trigger object.

 

Try this to have Triggers not kill your character: (not tested code)

function Script:Collision(entity,position,normal,speed)
if speed>20 and entity:GetCollisionType()~=Collision.Trigger then
 self:Hurt(100)
end
end

 

This didn't work, i tried playing with it a bit, and still nothing. But I did notice that it is still killing me even if the force is set under 20

Posted

Could you take a screenshot of the level and paint over to pt some text and say who BSP block uses what script ?

I think your problem is relative to collision management in some strange way, or not in better working one.

Stop toying and make games

Posted

Your problem could be BSP or physics on BSP, i played a good bunch with BSP , models and physics and there are some serious physic bugs. Perhaps you are in one of these physics problem ?

 

 

ok so how does game works ? you walk on yellow area and your character jumps ? on grey area nothing special just a walkable surface ?

is there any danger area ?

Stop toying and make games

Posted

Exactly. Hit yellow and you should jump up and into the blue. Grey is just for walking around. I expected with a jump force of 600 that hitting the blue would instantly kill me(My goal). Instead, I fly straight through and into the sky beyond.

Posted

The force is perhaps too high also :

I made some F-Zero style prototype using BSP cubes, and i got the bsp cube vehicle passing throught level caus of velocity.

Why not : reducing force and just detect blue collision ?

or use : PhysicsSetPosition to manually make the player fly vertical to blue until it collides with blue volume ?

OR use raycast above player head to detect the Y possible collision , and after yellow jump, make it jump until it reaches the players head , you could make it jump until it reaches or have a great Y value than Y collision reported by raycast. This way, you could use any velocity.

Stop toying and make games

Posted

The only solution that I have thought of is your second option. Because after lowering the force on the jump to where I don't pass straight through, I'm no longer travelling at a velocity that is strong enough to cause dmg.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...