TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
CASTON LYNCH
NA
4
2k
`Instantiate' does not exist in current context.
Dec 8 2017 3:42 PM
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.
Reply
Answers (
1
)
collision detection xna
Changing scenes after an objective is complete.