달력

6

« 2025/6 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
2012. 2. 16. 15:11

유니티 3d 카테고리 없음2012. 2. 16. 15:11

 http://cookzy.tistory.com/702 
http://devkorea.co.kr/bbs/board.php?bo_table=m04_6&subNum=7&wr_id=6&page=2 
speed;

void update()
{
float antToMove = speed * Time.deltaTime;
transform.Trnaslate(Vector3.down * antToMove , Space.world);



요래하면 배경이 아래로 움직임 

collider
->isTrigger() : 특정 이벤트시 호출되는 함수 

총알 구현
- isGravity : false
- isKis... : true 
- c#script

float amtToMove = spped * Time.deltaTime;
transform.Translate(Vector3.up * antoToMove);

- 총알이 계속 나간다 => 중간에 사라지게 해야함
- gameObject 자기자신 
- gameObject.transform == transform 

총알과 플레이어의 연관성을 가지게 하는 법
- prelap을 이용한다.
- 플레이어에 public GameObject prelap 선언
-  project의 preplap을 플레이어의 inspector에 드래그 앤 드롭 한다.
- 프리팹을 생성하는 코드는
   Instantiate(prefab, position, Quaternion.identity);
Quaternion이 머징?
- 총알이 플레이어의 가운데에서 나가기 위해 position을 조정해줘야함
position = new Vector3(transform.position.x , transform.position.y + transform.localScale.y / 2);


 
:
Posted by НooпeУ


Code Start Code End