Forum Replies Created

  • Sam Smith

    June 3, 2020 at 7:59 am in reply to: Time remap based on velocity/direction?

    Not sure either – when I mapped the vel output to a text string it seemed to be that I got one sprite for a positive number and another for the negative. It didn’t seem to know if it was a negative x or y.

    I don’t need a neutral state as the natural pose would be based on what sprite has just been displayed.

    I’m guessing that could be achieved with some kind of

    “if vel=0, then find vel-1 speed and use that”

    With the resting state, I think I’m just going to slow the vehicle sprite down so it appears to be stopped. The scene is zoomed out a fair way so it should be okay, and reduce the number of calculations as I have a lot of small car sprites going around the city.

    Thanks again for your help.

    Sam

  • Sam Smith

    June 2, 2020 at 7:39 pm in reply to: Time remap based on velocity/direction?

    Okay, Just in case anyone else is looking for this I think I’ve solved it using by adapting another piece of time-remap sprite code found on here by Charlie Laud.

    No all I need to do is work out how to keep it in the state it was before if speed = 0.

    directionNum = 0;
    dX = transform.xPosition.valueAtTime(time) - transform.xPosition.valueAtTime(time - framesToTime(1));
    dY = transform.yPosition.valueAtTime(time) - transform.yPosition.valueAtTime(time - framesToTime(1));

    if (dX > 0 && dY > 0) {directionNum = 0;}
    if (dX < 0 && dY < 0) {directionNum = 1;}
    if (dX < 0 && dY > 0) {directionNum = 2;}
    if (dX > 0 && dY < 0) {directionNum = 3;}

    framesToTime(directionNum)

  • Sam Smith

    June 2, 2020 at 3:32 pm in reply to: Time remap based on velocity/direction?

    Andrei,

    Appreciate I’m dragging this one back from a while ago but I’m trying to do something similar and hitting a brick wall.

    The problem is my object is moving on an isometric plane rather than straight up and down so there’s never a point where either axis is 0. Using the expression above it just jumps between two sprites (positive and negative)

    I’ve gotten as far as splitting the two dimensions out using the vel[0] and vel[1] but after that, I’m stumped.

    Any pointers in the right direction would be gratefully appreciated.

    Thanks,

    Sam

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy