Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

How do I properly use AimVector?

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
pillers
Meatbag
Posts: 7
Joined: Sun Dec 02, 2018 10:11 am
Title: Deluxe Superfighter
Age: 25

How do I properly use AimVector?

Post by pillers » Thu Jan 24, 2019 2:24 am

I'm trying to spawn a projectile with the direction of the players AimVector like this.

Code: Select all

Game.SpawnProjectile(ProjectileItem.REVOLVER, this.ply.GetWorldPosition, this.ply.AimVector);
But this line of code gives me an error message that reads.
CS1503 Argument 2: cannot convert from 'method group' to 'SFDGameScriptInterface.Vector2'
What exactly am I doing wrong and how do I fix it?
0 x

Code: Select all

while true

User avatar
Sree
Superfighter
Superfighter
Posts: 325
Joined: Sun May 08, 2016 8:19 pm
SFD Account: phasmic
SFD Alias: sree
Gender:
Age: 23

Post by Sree » Thu Jan 24, 2019 8:29 am

You forgot the parenthesis after GetWorldPosition, that is the reason for the error.
1 x

Post Reply