Spawn Avatar in front of User
Hi folks,
I have been trying to spawn an avatar model a few feet in front of the main view. I can get it to spawn at the location of the main view but not in front. I can offset the spawn location but not in relation to the viewpoint. Any help would be much appreciated. Code:
def AddBot(): |
Here's an example, navigate around and you'll see a pigeon appear in front of the view every two seconds:
Code:
import viz |
Thank you,
This worked like a charm. |
You can use the player.transform.forward direction to get the players direction as a vector and transform.rotation to get the orientation. You can also do math operations of vectors which makes things so much better than modifying the components.
|
All times are GMT -7. The time now is 11:34 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC