Get a 3D Model to spin into its own axis?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
XASSASSINX
Posts: 382
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Get a 3D Model to spin into its own axis?

Post by XASSASSINX »

Hello everyone. I've never used 3D models until now for anything i've created, and i'm having a little bit of trouble regarding spinning an actor pitch or roll. Here's the model definition:

Code: Select all

Model UK_Coin
{
	Path "Models"
	Model 0 "marksmancoin.obj"
	Skin 0 "markcointxt"
	Scale 25.0 25.0 25.0
	//PitchOffset 100
	//RollOffset 100
	+USEACTORPITCH
    +USEACTORROLL
	/*+PITCHFROMMOMENTUM
	ROTATING
	Rotation-Vector 0.0 0.0 -1.0
	Rotation-Center 0.0 0.0 -20.0
	Rotation-Speed 8*/
	FrameIndex RMKC A 0 0
}
(The commented parts are debugging attempts, using the pre-made Rotation-Vector property does work, but then it will become relative to the player firing position, so the coin will spin on a random axis, per say.)
(Also, i'd like to point out that using the "PitchOffset" property DOES change the model pitch, so it just makes this more confusing as to why the following is not working:)

Code: Select all

    Spawn:
    RMKC A 1 
    {
        self.angle += 10;
	self.roll += 25;   
        self.pitch += 8;   
    }
		Loop;
Any other form to try to manipulate this, such as using any action like A_SetPitch, A_SetRoll does not work either. The only thing that works in those 3 lines is the angle modification, and the coin spins on that axis like a frisbee)

Code: Select all

        Radius 35;
        Height 5;
        //Gravity 0.7;
        Gravity 0.0;
		+NOTELEPORT
		+MISSILE
		//+RollSprite
		+FRIENDLY
        +SHOOTABLE
        +THRUACTORS
		-NoGravity
		+InterpolateAngles
        RenderStyle "Normal";
        Scale 1.0;
		Health 1;
		
Heres the class flags and properties. I've played around a bunch and read of the wiki, no combinations have worked thus far. Any tips on what might be happening?
(Also, extra: if using the Rotation-Vector property, the coin is "orbiting" around the center, not into herself, but that's probably a model misaligment, i'll fix it later with Rotation-Center or messing with model)

Any tips?
Post Reply

Return to “Scripting”