2017-10-07 80 views

回答

0
i try this but still i get the wrong direction. 

Vector3 dir = target.transform.position - transform.position; 
    Quaternion s = Quaternion.LookRotation(dir); 
    GameObject gm = (GameObject)Instantiate(BulletPrefab, BulletPoint.position,s); 

ScreenShot

+1

你可以在你自己的问题下发表评论。这不是一个答案。顺便说一句,你必须在实例化对象之后使用LookRotation,而不是在它之前 – Programmer

+0

是我的错误。 TNX虐待尝试 –

+0

仍然无法正常工作。即时通讯看教程。在教程子弹只是一个领域,所以他没有方向问题, –

0

TNX,伙计们。问题解决了。
我只是创建一个空的游戏对象,并通过调整空游戏对象来修复透视。

 GameObject monster = (GameObject)Instantiate(Resources.Load("Bullet")); 
    monster.transform.position = BulletPoint.transform.position; 
    monster.transform.rotation = BulletPoint.transform.rotation; 
相关问题