Game Development Community

VectorFromAngle(Value): The name 'Value' does not exist in current context.

by Arden · in Torque X 2D · 09/10/2010 (8:55 pm) · 4 replies

Hey guys,

Here is a problem I ran in that's blocking me. I'm using multistate animations in my project, so I have different types of walking animations based on player input defined in a Humanoid component. Now, I'm working on a second component, conveniently named WeaponComponent, where I have the FireWeapon() method, which contains the following public properties:

public Vector2 Direction
        {
            set { _direction = value; }
        }

        public float DirectionAngle
        {
            set { _direction = T2DVectorUtil.VectorFromAngle(Value); }
        }

My problem is that whatever I do, I get the message that (Value) in set { _direction = T2DVectorUtil.VectorFromAngle(Value); does not exist in the current context.

From the Humanoid component, I call a method on the WeaponComponent.

public void Fire()
        {
            WeaponComponent weapon = Owner.Components.FindComponent<WeaponComponent>();
            weapon.DirectionAngle = ((T2DSceneObject)Owner).Rotation;
            weapon.FireWeapon();
        }

Any help appreciated.
thx

#1
09/10/2010 (9:46 pm)
Hey Arden, there is no "Value"... the "v" shall be lower case ;)
#2
09/10/2010 (9:51 pm)
.... I'm speechless. I spent like 2 hours looking in going over my methods.... I feel humbled (and a little bit naive) as well as very greatful for you to take the time to point this out.

Write a long post for the most simple solution = Achievement unlocked!
#3
09/10/2010 (10:06 pm)
It happens to all of us when we are looking at the same code over and over again :) My solution is to stop and have some coffee... a lot of black and strong Italian coffee ;)
#4
09/10/2010 (11:03 pm)
Hehehe. Will try that :b