Profile image

selectedWeapon into float?

163 AuthenticCabbages  2.2 years ago

selectedWeapon always comes out as a string and I can't use maths on it. Here is my dumb code.

Variable Expression
Rotation | clamp(sum((Weapon-2)*45), -1,1)

Weapon | SelectedWeapon = "weaponname"

This is for a rotating missile array. I'm trying to use the weapon name as a designation of where it is.

  • Log in to leave a comment
  • Profile image

    @Griffon1 Yeah that's what I was thinking unfortunately. I'm just trying to find a cheat around this lol

    +1 2.2 years ago
  • Profile image

    You can’t figure out weapon position unless you attach flight computers to them unfortunately

    2.2 years ago
  • Profile image
    14.2k Griffon1

    I think you'd have to just ask for specific names in a function, like the following
    SelectedWeaponName=(name 1)?1:SelectedWeaponName=(name 2)?2:... (etc.)
    If theres a way around this I'd love to hear it but its the only way I know.

    2.2 years ago