Jump to content
GreenSock

ChimCode

Program Breaks when trying to use MotionPathHelper

Moderator Tag
Go to solution Solved by GreenSock,

Recommended Posts

Hello,


I am newer to GSAP but I love it. I recently signed up for Club GreenSock. This is also the first time I have ever looked for help on a form, so sorry if I am breaking edict or do something annoying on accident.  

 My issue is I am trying to get the MotionPathHelper to work, and my browser always breaks when I add the following line.
MotionPathHelper.create('#myimage')

The error I get is TypeError: Cannot read property 'core' of undefined

I am using React. I'm importing gsap and the plugin as your docs say to. I am also registering the app gsap.registerPlugin(MotionPathPlugin) 

Hopefully this can get me some help,

Matthew 

gsapCode1.JPG

gsapCode2.JPG

gsapCode3.JPG

Link to comment
Share on other sites

  • Solution

It sounds like you just forgot to register the plugin :)

gsap.registerPlugin(MotionPathPlugin, MotionPathHelper);

 

Link to comment
Share on other sites

Haha oh lord. Thank you! I am a dummy lol

  • Like 1
  • Haha 1
Link to comment
Share on other sites

@ChimCode trust me, you're not the only one who has forgotten to register a plugin. I've done it myself a couple of times and I wrote the whole stinkin' platform! :)

 

Happy tweening!

  • Haha 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×