Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
Sign in to follow this  

Анимирование объекта

Как можно анимировать объект, допустим чтобы он вертелся вокруг своей оси или плавал вверх-вниз?
Я пробую такой код, но объект просто весит без движений.
Спавню объект так - GetGame().CreateObject("DZRP_Artefact_Compas","4672.702637 339.400177 10353.235352",false,false,true);
Анимирую так - 

if ( GetGame().IsClient()  ||  !GetGame().IsMultiplayer() )
                if( GetPosition() )
                    pos = GetPosition();
                    pos[1] = pos[1] + 1.5;
                    dynamicPos = pos;
                    if (!m_Animate)
                        m_Animate = new Timer( CALL_CATEGORY_SYSTEM );	
                    Print("Animation work");
                    m_Animate.Run( 0.1, this, "Animate", NULL, true);
    void Animate()
        if ( dynamicPos[1] < (pos[1] - 0.5)  )
            dynamicPos[1] = dynamicPos[1] + 0.05;
        if (  dynamicPos[1] > pos[1]  )
            dynamicPos[1] = dynamicPos[1] - 0.05;
        //direct = GetDirection();
        ornt = GetOrientation();
        // direct[0] = direct[0] + 0.1;
        // direct[2] = direct[0] + 0.1;
        ornt = ornt * 0.05;
        //ornt[2] = ornt[2] + 0.05;


Share this post

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.