using UnityEngine;
public class FrezePosition : MonoBehaviour
{
private void OnTriggerEnter2D(Collider2D other)
{
gameObject.GetComponent().constraints = (RigidbodyConstraints2D)RigidbodyConstraints.FreezePositionX | (RigidbodyConstraints2D)RigidbodyConstraints.FreezePositionY;
}
}
//Я решил проблему!!!
using UnityEngine;
public class FrezePosition : MonoBehaviour
{
private void OnTriggerEnter2D(Collider2D other)
{
gameObject.GetComponent().constraints = RigidbodyConstraints2D.FreezePositionX | RigidbodyConstraints2D.FreezePositionY;
}
}
English speaking forum here.
If you post a code snippet, ALWAYS USE CODE TAGS:
How to use code tags: Using code tags properly
How to report your problem productively in the Unity3D forums:
- what you want
- what you tried
- what you expected to happen
- what actually happened, log output, variable values, and especially any errors you see
- links to actual Unity3D documentation you used to cross-check your work (CRITICAL!!!)
According to google translate, the title of the thread is: " There is a problem when touching the trigger, only the Y coordinate is fixed. How to fix it", but then you replied “I solved the problem”. I guess just another russian can understand russian, so try to make posts in english pls
Согласно гугл-переводчику, название темы такое: “Проблема при касании триггера, фиксируется только координата Y. Как исправить”, но потом вы ответили “Я решил проблему”. Я думаю, что еще один русский может понять русский, поэтому постарайтесь писать сообщения на английском, пожалуйста.
1 Like