Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class WeldTogether : MonoBehaviour
- {
- public ParticleSystem part;
- int abra = 0;
- public GameObject obj;
- public List<ParticleCollisionEvent> collisionEvents;
- // Start is called before the first frame update
- void Start()
- {
- }
- private void Update()
- {
- //Debug.Log(abra.ToString());
- }
- private void OnParticleCollision(GameObject other)
- {
- Debug.Log("kek");
- abra = 1;
- }
- private void OnCollisionEnter(Collision other)
- {
- if (other.gameObject.GetComponent<Rigidbody>() != null)
- Debug.Log("lol");
- {
- if (abra == 1)
- {
- FixedJoint tmp = obj.AddComponent<FixedJoint>();
- tmp.connectedBody = other.rigidbody;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement