Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void CreateObject()
- {
- if (_target.active==true)
- {
- if (objects.Length > 0)
- {
- Instantiate(objects[0], new Vector3(_target.transform.position.x, _target.transform.position.y+ FindNewPos(), _target.transform.position.z), Quaternion.identity);
- Debug.Log(PosNewObject);
- }
- }
- }
- private float FindNewPos()
- {
- if (MultyRayCast(_target.transform.up, Color.red))
- {
- return PosNewObject = hit.collider.GetComponent<Renderer>().bounds.size.y/2;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement