yian Posted September 15, 2017 Share Posted September 15, 2017 I am wondering if it is possible to place an item in game, say, a giant eyeball, and it will move as the player moves, like it is tracking the player's movement. My proposed solution is this - place a new NPC in game, and give her/him invisible meshes for clothes and a huge eyeball as helmet. The AI package will take care of the rest. The eyeball (helmet) will move with the NPC's head as the player moves around, just like in the default game. Now, here are two problems with that: 1) the NPC and the helmet will have collision. But I need to inset this eyeball into a wall or some space that requires meshes intersecting each other. and, 2) I don't know how to keep an NPC staying in one place without moving around. So, can these issues be overcome, or is there a far simpler way of creating a big eyeball in-game that could track player's movements? Thank you. Link to comment Share on other sites More sharing options...
cdcooley Posted September 15, 2017 Share Posted September 15, 2017 Antistar's Clockwork mod has skulls that are scripted to turn and face the player. The custom script used by that mod is CLWObjectFaceTargetScript if you want to unpack its BSA and take a look. The important parts are calls to GetHeadingAngle so that you know the current angle of the item compared to the player's position (from the item's point of view) and SplineTranslateTo (or just TranslateTo) to turn the object trying to keep the heading angle at zero. I remember similar scripts used in Morrowind mods although back then we had to use SetAngle to rotate the item which wasn't as smooth looking as the translate function's behavior. Link to comment Share on other sites More sharing options...
yian Posted September 16, 2017 Author Share Posted September 16, 2017 Amazing! I will take a look. Thank you once again cdcooley! Link to comment Share on other sites More sharing options...
Recommended Posts