playMaker

Author Topic: Add Force 2D makes object go through collider (SOLVED)  (Read 2300 times)

Just

  • Playmaker Newbie
  • *
  • Posts: 41
Add Force 2D makes object go through collider (SOLVED)
« on: August 13, 2016, 12:46:53 PM »
How do I stop that happening?
« Last Edit: August 14, 2016, 11:27:02 AM by Just »

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Add Force 2D makes object go through collider
« Reply #1 on: August 13, 2016, 04:56:45 PM »
Add a collider to object?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Add Force 2D makes object go through collider
« Reply #2 on: August 13, 2016, 04:59:40 PM »
Hi,
Could you give some more information (pictures/videos)

Some reason could be that if the speed of your object is very fast,
that it "jumps over" the collider a solution could be to slower the speed or make the collider bigger, there is a edit collider button on the collider component so you can resize it without resizing the object

Just

  • Playmaker Newbie
  • *
  • Posts: 41
Re: Add Force 2D makes object go through collider
« Reply #3 on: August 13, 2016, 05:27:13 PM »

I recorded video how it works for me currently. What I didn't mention in my video both playable character and everything in level has collider. In 1:23 mark it shows the problem, I also did some explaining about my project in the beginning of video.

Let me know if you need more information.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Add Force 2D makes object go through collider
« Reply #4 on: August 14, 2016, 09:31:21 AM »
Hi,
the ad force is a low number but that does not mater,
it is how much you object is moving per frame that might cause not seeing a collider.

What kind of colliders are you using on the character and on the floors?
(box,sphere,edge...)

Maybe you can use a "raycast" upwards before jumping and when there is an obstacle don't do the add force?

Just

  • Playmaker Newbie
  • *
  • Posts: 41
Re: Add Force 2D makes object go through collider
« Reply #5 on: August 14, 2016, 11:26:26 AM »
It seems using Raycast 2D underneath platform solved my problem neatly  :)

Thank you everyone!

EDIT: Oh yeah, and those with similar problem reading this later: put negative number in Y for Raycast to stop Add Force going through platform (just 0 won't do anything).
« Last Edit: August 15, 2016, 05:12:22 AM by Just »