Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / SetObjectLookat() Does this work with LoadObjectwithChildren?

Author
Message
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 12th May 2017 02:30 Edited at: 12th May 2017 02:52
I am attempting to use this on objects that are animated. I can not get it to work. It looks exactly away from my object. Making the z axis negative has no impact. Making the x and z axis negative has no impact.

NPCangle = atan2(playerlocation_x#-object_x#, playerlocation_z#-object_z#)

SetObjectRotation (objId, 0, NPCangle-180, 0)


This makes the 3d object face me. Kinda feels like BS, since that is 2d math, but whatever.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 14th May 2017 16:48
Seems like your object is back to front in the first place?

Login to post a reply

Server time is: 2024-11-22 07:54:24
Your offset time is: 2024-11-22 07:54:24