Hi, i really want to know whether there is a problem with collision or my script, in my short project a sprite will move from bottom to top but it isnt being detected when colliding with a static body, and the code for both for the water movement script and end script is below
WatMov.cs :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WaterMov : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.position+=(new Vector3(0.0f,(transform.position.y)-0.50fTime.deltaTime,0.0f));
Debug.Log (“X position:” + transform.position.x);
Debug.Log (“Y position:” + transform.position.y);
Debug.Log (“Z position:” + transform.position.z);
}
}
stageEnd.cs:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class stageEnd : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnCollisionEnter2D(Collision2D colbj)
{
if (colbj.gameObject.tag ==“objective”)
{
Debug.Log (“entered”);
Time.timeScale = 0;
}
}
}
3390914–266569–stageEnd.cs (416 Bytes)
3390914–266570–WaterMov.cs (512 Bytes)



