Help a simple script please

Post » Thu Dec 20, 2012 7:01 pm

Hello
I have placed a game object inside a cell and I checked "Don't Havok Settle" in order not to let the object fall on the ground when the game starts. I have added a trigger once object with a script attached to it in order to make the object fall on ground once the player enter it.
what function do i need to add to my script ?

Spoiler
Scriptname GP_TriggerOnce extends ObjectReferenceActor Property PlayerRef  AutoWeapon Property Weapon01 AutoAuto State AutoStateEvent OnTriggerEnter(ObjectReference akActionRef)	If akActionRef == PlayerRef  ;Add function here To Add Havok to Weapon01 To Fall on Ground  GoToState("")EndIfEndEventEndState
User avatar
W E I R D
 
Posts: 3496
Joined: Tue Mar 20, 2007 10:08 am

Post » Thu Dec 20, 2012 10:54 am

Try the following, where you have ;add function here:

if Weapon01.Is3DLoaded()    Weapon01.ApplyHavokImpulse(0.0, 0.0, 1.0, 1.0)endif

This will apply an extremely weak havok impulse to the weapon in the downward (z) direction. It should cause it to settle naturally.

Also, from the sound of it, Weapon01 needs to be of type ObjectReference, not Weapon. You want to point at the particular weapon in the cell in question, not the base weapon object.
User avatar
Jack Moves
 
Posts: 3367
Joined: Wed Jun 27, 2007 7:51 am


Return to V - Skyrim