playMaker

Author Topic: Block Issues  (Read 1673 times)

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Block Issues
« on: December 19, 2021, 11:06:13 PM »
Hello,

I have blocks that I can pick up and move to solve puzzles in my game. However, when I push several blocks into each other or force is applied to stacked blocks, the blocks glitch out. Usually they'll jitter, but sometimes they will go through colliders despite having collision detection set to continuous on the rigid bodies. I tried messing around with the Interpolate settings, but that didn't seem to do much. What  would you recommend so that blocks act more firm, when other blocks are pushed against them. Note this is a 2d game. Also, I have friction set to really high (like 100,000 or something like that so that I can't push the blocks). Thanks in advance!

John Bassi

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Block Issues
« Reply #1 on: December 20, 2021, 09:14:22 AM »
Hi.
Maybe try setting the blocks that should not move to static.

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Block Issues
« Reply #2 on: December 20, 2021, 03:35:00 PM »
I'll be honest, that didn't seem to do much. Any other ideas?

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Block Issues
« Reply #3 on: December 20, 2021, 03:48:46 PM »
Actually, with more testing, it helped a little. I'm still able to get blocks to be inside each other and they still jitter (I also still assume it is possible for them to go through walls with some tinkering). It is better though. Any other thoughts to fully prevent it?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Block Issues
« Reply #4 on: December 21, 2021, 09:16:57 AM »
Hi.
How are the blocks moved?

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Block Issues
« Reply #5 on: December 21, 2021, 02:46:07 PM »
They become a child of the player. This happens through a trigger 2d event. I freeze the z axis and set the position of the block in front of the player. I also make sure there is no force being applied by setting the x axis to 0 through set velocity 2d and add force 2d. I don’t set y to 0 so the blocks don’t float in mid air. Any idea of what’s wrong? Thanks so much!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Block Issues
« Reply #6 on: December 22, 2021, 10:00:08 AM »
Hi.
Maybe you can try having it to follow a point with velocity.
or have some casts to check if hitting something and when it does to stop move.

I'm just thinking out loud.

I would suggest to look on the unity forum and/or ask there as well.
and on Playmaker discord channel.

if its for VR, maybe this post can help :
https://answers.unity.com/questions/1682069/physics-question-in-vr-when-hitting-an-object-with.html

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Block Issues
« Reply #7 on: December 28, 2021, 12:05:06 AM »
I think it is more of a collision issue. I tried posting on the main unity forums, but no response. You don't know of any videos that show how to do movable blocks? Maybe if I start it from scratch with a new perspective it will work. Let me know. Thanks!

John Bassi