G
G
Gregory2562021-08-30 13:45:44
C++ / C#
Gregory256, 2021-08-30 13:45:44

How to call the OnCollisionStay method inside another method?

Good day, please tell me how can I call OnCollisionStay inside another method?
That is, I want to prescribe the condition: "on button click". Or how is it possible to constantly call the OnCollisionStay method, because it goes through several iterations and then stops working.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Spartanec33, 2021-08-30
@Gregory256

OnCollisionStay itself is called every frame when the objects touch. it cannot be invoked intentionally. It is possible to do check in OnCollisionStay. or in OnCollisionStay assign true to some boolean variable, though you have to think about where to make this boolean variable false. And depending on the value of the variable, do something in the method

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question