Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
`Instantiate' does not exist in current context.
CASTON LYNCH
Dec 8 2017 3:42 PM
181
Reply
Hello! I am currently in a game design class using Unity 5.6.1, and I'm working on a script for a cube that shoots out a capsule as a bullet-style weapon. A piece of the code I have is as shown below:
void FixedUpdate()
{
if (Input.GetButton ("Fire1") && Time.time > nextFire)
{
nextFire = Time.time + fireRate;
Instantiate(shot, shooter.position, shooter.rotation);
}
}
However, on the Instantiate line, I'm getting the error "The name `Instantiate' does not exist in the current context". Can someone help me out or tell me what I'm doing wrong? Attached is a picture of the whole script if that helps at all.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
collision detection xna
hey are yiu there