simsam Posted January 28, 2013 Share Posted January 28, 2013 (edited) Hi guys, I'm looking to make the combat style target centered (like a zelda). You push a button, it gets the best target and sets it as center of movement.I got the spell working and acquisition of the target alright but i cannot seem to find the proper way to orient the camera on it. I manage to do the exact opposite (npc will look at me and keep facing me while moving) using setlookat(target, true)But the player doesn't seem to accept that function. So i tried changing the player Z angle to face the target (GetHeadingAngle will return the angle to the target), and run that script every n seconds.It works fine for long time intervals. But when i go under 0.1, it gets very jumpy.... the same positions will result in different results........ does space and time get distorted in between frames? I did the math myself to ensure the getheadingangle wasn't bugged, and the same jumpiness happens when i lower the update interval. Does arc tangent have some divide by zero error? I'm wondering if any of you had this kind of problem before, and if there are camera controls that i missed (i am using player.setangle to orient the view, as i cannot find the camera object...) This is my first attempt at modding Skyrim, and these bugs are quite disappointing... Thanks for your help! Edited January 28, 2013 by simsam Link to comment Share on other sites More sharing options...
steve40 Posted February 3, 2013 Share Posted February 3, 2013 (edited) The player orientation is controlled by the mouse, and will probably override any scripted movement. Try disabling player movement controls. It might also be one of these features that only works natively on NPC's (like player headtracking). There's an animation graph bool variable, "IsNPC" iirc. You might have to set that flag (using SetAnimationVariableBool) for it to work. I think the Player Headtracking mod does something like this to pull it off. Edited February 3, 2013 by steve40 Link to comment Share on other sites More sharing options...
Recommended Posts