playMaker

Author Topic: how can i help collision deduct number ?  (Read 734 times)

Strom_555

  • Playmaker Newbie
  • *
  • Posts: 4
how can i help collision deduct number ?
« on: December 28, 2021, 07:35:08 AM »
hi i need help i am a beginner how do i set an object to subtract a number when i touch a certain object in a collision?
« Last Edit: December 28, 2021, 07:39:14 AM by Strom_555 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7622
    • jinxtergames
Re: how can i help collision deduct number ?
« Reply #1 on: December 28, 2021, 10:36:39 AM »
Hi.
are you colliding with another object or when you touch with your finger (on screen)

if object you can use collision(2D) event and on collision Enter you can subtract.

Strom_555

  • Playmaker Newbie
  • *
  • Posts: 4
Re: how can i help collision deduct number ?
« Reply #2 on: December 28, 2021, 10:54:14 AM »
thanks for the reply, i am using 3d and this is a photo but it does not work

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7622
    • jinxtergames
Re: how can i help collision deduct number ?
« Reply #3 on: December 28, 2021, 10:55:57 AM »
Hi.
Does 1 of the objects have a rigidbody?

are both objects not set as triggers?

if set as trigger then you need to use trigger event.

Strom_555

  • Playmaker Newbie
  • *
  • Posts: 4
Re: how can i help collision deduct number ?
« Reply #4 on: December 28, 2021, 11:04:54 AM »
yes the crowbar has a rigidbody, if they both have triggers I don't know, should it be like this? thank you for answer

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7622
    • jinxtergames
Re: how can i help collision deduct number ?
« Reply #5 on: December 30, 2021, 09:44:07 AM »
Hi.
If one of the objects Collider is set as trigger then you need to use trigger events.

on the image i can see that the 'Tag' is empty

also double check the Project Settings/Physics/Layer Collision Matrix if the layer of the 2 objects can detect collision